Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcdeb0ab authored by Fynn Godau's avatar Fynn Godau Committed by Marvin W.
Browse files

Complete polygon stroke

parent 7d13ef2a
Loading
Loading
Loading
Loading
+14 −6
Original line number Original line Diff line number Diff line
@@ -191,11 +191,15 @@ class PolygonImpl(private val map: GoogleMapImpl, id: String, options: PolygonOp


    override val strokes = (listOf(
    override val strokes = (listOf(
        PolylineImpl(
        PolylineImpl(
            map, "$id-stroke-main", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(points)
            map, "$id-stroke-main", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(
                (points + points.firstOrNull()).filterNotNull()
            )
            )
    ) + holes.mapIndexed { idx, it ->
        )
    ) + holes.mapIndexed { idx, holePoints ->
        PolylineImpl(
        PolylineImpl(
            map, "$id-stroke-hole-$idx", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(it)
            map, "$id-stroke-hole-$idx", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(
                (holePoints + holePoints.firstOrNull()).filterNotNull()
            )
        )
        )
    }).toMutableList()
    }).toMutableList()


@@ -233,11 +237,15 @@ class LitePolygonImpl(id: String, options: PolygonOptions, private val map: Lite


    override val strokes: MutableList<AbstractPolylineImpl> = (listOf(
    override val strokes: MutableList<AbstractPolylineImpl> = (listOf(
        LitePolylineImpl(
        LitePolylineImpl(
            map, "$id-stroke-main", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(points)
            map, "$id-stroke-main", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(
                (points + points.firstOrNull()).filterNotNull()
            )
            )
    ) + holes.mapIndexed { idx, it ->
        )
    ) + holes.mapIndexed { idx, holePoints ->
        LitePolylineImpl(
        LitePolylineImpl(
            map, "$id-stroke-hole-$idx", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(it)
            map, "$id-stroke-hole-$idx", PolylineOptions().color(strokeColor).width(strokeWidth).addAll(
                (holePoints + holePoints.firstOrNull()).filterNotNull()
            )
        )
        )
    }).toMutableList()
    }).toMutableList()