This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: android labels not using colour correctly

+4 -16
+1 -1
posedetection/build.gradle.kts
··· 6 6 7 7 mavenPublishing { 8 8 publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) 9 - coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.4.0") 9 + coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.5.1") 10 10 11 11 pom { 12 12 name.set("Pose Detection")
+2 -1
posedetection/src/androidMain/kotlin/com/performancecoachlab/posedetection/camera/LabelTextAndroid.kt
··· 2 2 3 3 import androidx.compose.ui.graphics.drawscope.DrawScope 4 4 import androidx.compose.ui.graphics.nativeCanvas 5 + import androidx.compose.ui.graphics.toArgb 5 6 import androidx.compose.ui.text.TextMeasurer 6 7 7 8 actual fun DrawScope.drawLabelTextPlatform( ··· 31 32 32 33 val paint = android.graphics.Paint().apply { 33 34 isAntiAlias = true 34 - color = android.graphics.Color.WHITE 35 + color = drawableObject.colour.toArgb() 35 36 textAlign = android.graphics.Paint.Align.LEFT 36 37 textSize = baseTextSizePx 37 38 }
-13
posedetection/src/commonMain/kotlin/com/performancecoachlab/posedetection/camera/Utils.kt
··· 163 163 ) 164 164 165 165 DrawableShape.LABEL -> { 166 - // Draw the label background 167 - drawRect( 168 - color = drawableObject.colour, 169 - topLeft = androidx.compose.ui.geometry.Offset( 170 - drawableObject.obj.boundingBox.left, 171 - drawableObject.obj.boundingBox.top 172 - ), 173 - size = Size( 174 - drawableObject.obj.boundingBox.width, 175 - drawableObject.obj.boundingBox.height 176 - ), 177 - style = drawableObject.style 178 - ) 179 166 // Defer actual text rendering to platform-specific implementation 180 167 drawLabelTextPlatform( 181 168 drawableObject = drawableObject,
+1 -1
sample/composeApp/src/commonMain/kotlin/com/nate/posedetection/App.kt
··· 360 360 obj.map { 361 361 DrawableObject( 362 362 obj = it, 363 - shape = DrawableShape.RECTANGLE, 363 + shape = DrawableShape.LABEL, 364 364 colour = Color.Yellow, 365 365 style = Stroke(it.boundingBox.width * 0.1f) 366 366 )