image with painter

This commit is contained in:
Lev Shagalov 2022-07-14 14:52:42 +03:00
parent bebd33f859
commit f3b67cffe9

View File

@ -4,8 +4,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Size import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.VectorPainter
import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.IntSize
import centre.sciprog.maps.GeodeticMapCoordinates import centre.sciprog.maps.GeodeticMapCoordinates
@ -51,9 +51,9 @@ class MapBitmapImageFeature(
) : MapFeature(zoomRange) ) : MapFeature(zoomRange)
class MapVectorImageFeature internal constructor( class MapVectorImageFeature (
val position: GeodeticMapCoordinates, val position: GeodeticMapCoordinates,
val painter: VectorPainter, val painter: Painter,
val size: Size, val size: Size,
zoomRange: IntRange = defaultZoomRange, zoomRange: IntRange = defaultZoomRange,
) : MapFeature(zoomRange) ) : MapFeature(zoomRange)
@ -64,4 +64,4 @@ fun MapVectorImageFeature(
image: ImageVector, image: ImageVector,
size: Size = Size(20f, 20f), size: Size = Size(20f, 20f),
zoomRange: IntRange = defaultZoomRange, zoomRange: IntRange = defaultZoomRange,
): MapVectorImageFeature = MapVectorImageFeature(position, rememberVectorPainter(image), size, zoomRange) ): MapVectorImageFeature = MapVectorImageFeature(position, rememberVectorPainter(image), size, zoomRange)