Skip to content

Commit

Permalink
position drawing was added to cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAsmirko committed Mar 16, 2021
1 parent 159c9aa commit 5dfd9b3
Show file tree
Hide file tree
Showing 47 changed files with 38 additions and 10 deletions.
Binary file modified .gradle/6.7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified build/classes/kotlin/main/LocationMarkerComposableKt.class
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ъЯРВВВВВВВВВВВВВВВВВВВВВЗЖЬйт
пёђїїїїїїїїїїїїїїїїїїїїїњіјЪдЯввввввввввввввввввввввввввввв
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
������������
켆
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
К*в*в*ж*э*к*к*к*к*к*к*к*к*к*к*к*к*н*ч*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*к*о*Й+В+В+к0
ë*×*×*Ö*Ü*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Î*Þ*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ë*Ï*ê+÷+÷+Ë0á.å.å.å.å.å.å.å.å.å.Ã2Ò2Æ3Æ3Ð1Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0Í0
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

4 changes: 2 additions & 2 deletions build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
268
264
298
294
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
уЩвКЯУыАпГюыщщйИгбшЪоясдПДИКЪЬлШэЧВйРчрЖШВюэДьвзбдмиЫЪЮьФдйНзЕФбЕщшюысЩполиЯЫуионщХпОПЭзЕрыУбТцрэфбпфуЕяигяЖВдЭЗИвЙИСб
йефЬНВУасыьГгВАУМЖеЭгтКбцЯлкЧрщР!ПХК уГВ!РЕцсУЧэЭТКЫКтГь ХвювЗ
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file not shown.
35 changes: 32 additions & 3 deletions src/main/kotlin/LocationMarkerComposable.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@file:Suppress("NAME_SHADOWING")

import androidx.compose.material.rememberBottomDrawerState
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Canvas
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.nativeCanvas
import org.jetbrains.skija.*

val font = Font(Typeface.makeDefault(), 24f)

fun Canvas.drawLocationMarker(
path: Path,
Expand Down Expand Up @@ -51,7 +53,6 @@ fun Canvas.drawLocationMarker(
mData[7] + mDifference
)
translate(originX, originY)
scale(1f, 1f)
path.reset()
drawPath(
path.apply {
Expand Down Expand Up @@ -94,5 +95,33 @@ fun Canvas.drawLocationMarker(
},
paint
)
val startX = -circleRadius / 2
val startY = -circleRadius * 2
var curPos = startX
val textItems = font
.getStringGlyphs(originX.toString())
.map {
val res = Pair(it, Point(curPos, startY))
curPos += font.size * 2 / 3
res
}
nativeCanvas.drawTextBlob(
TextBlob.makeFromPos(
textItems
.map { it.first }
.toShortArray(),
textItems
.map { it.second }
.toTypedArray(),
font
),
originX,
originY,
font,
org.jetbrains.skija.Paint().apply {
color = 0xff000000.toInt()
}
)
path.reset()
restore()
}
Binary file added src/main/resources/fonts/InterHinted-Regular.ttf
Binary file not shown.

0 comments on commit 5dfd9b3

Please sign in to comment.