0.3.0 #23

Open
altavir wants to merge 40 commits from dev into main
5 changed files with 29 additions and 12 deletions
Showing only changes of commit 1caf141d27 - Show all commits

View File

@ -9,17 +9,17 @@ job("Publish") {
gitPush { enabled = false }
}
container("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3") {
env["SPACE_USER"] = Secrets("space_user")
env["SPACE_TOKEN"] = Secrets("space_token")
env["SPACE_USER"] = "{{ project:space_user }}"
env["SPACE_TOKEN"] = "{{ project:space_token }}"
kotlinScript { api ->
val spaceUser = System.getenv("SPACE_USER")
val spaceToken = System.getenv("SPACE_TOKEN")
// write version to the build directory
// write the version to the build directory
api.gradlew("version")
//read version from build file
//read the version from build file
val version = java.nio.file.Path.of("build/project-version.txt").readText()
val revisionSuffix = if (version.endsWith("SNAPSHOT")) {
@ -32,7 +32,7 @@ job("Publish") {
project = api.projectIdentifier(),
targetIdentifier = TargetIdentifier.Key("maps-kt"),
version = version+revisionSuffix,
// automatically update deployment status based on a status of a job
// automatically update deployment status based on the status of a job
syncWithAutomationJob = true
)
api.gradlew(

View File

@ -6,11 +6,11 @@ plugins {
id("space.kscience.gradle.project")
}
val kmathVersion: String by extra("0.3.1-dev-RC")
val kmathVersion: String by extra("0.3.1")
allprojects {
group = "center.sciprog"
version = "0.2.2"
version = "0.2.3-dev-1"
repositories {
mavenLocal()

View File

@ -55,7 +55,6 @@ fun App() {
val centerCoordinates = MutableStateFlow<Gmc?>(null)
val pointOne = 55.568548 to 37.568604
val pointTwo = 55.929444 to 37.518434
// val pointThree = 60.929444 to 37.518434
@ -90,6 +89,7 @@ fun App() {
println("line 3 clicked")
}
multiLine(
points = listOf(
55.742465 to 37.615812,
@ -101,6 +101,15 @@ fun App() {
),
)
points(
points = listOf(
55.744 to 38.614,
55.8 to 38.5,
56.0 to 38.5,
)
).pointSize(5f)
//remember feature ID
val circleId = circle(
centerCoordinates = pointTwo,
@ -120,9 +129,11 @@ fun App() {
arc(pointOne, 10.0.kilometers, (PI / 4).radians, -Angle.pi / 2)
line(pointOne, pointTwo, id = "line")
text(pointOne, "Home", font = { size = 32f })
pixelMap(
space.Rectangle(
Gmc(latitude = 55.58461879539754.degrees, longitude = 37.8746197303493.degrees),

View File

@ -170,3 +170,6 @@ public object StrokeAttribute : Attribute<Float>
public fun <T : Any, F : LineSegmentFeature<T>> FeatureRef<T, F>.stroke(width: Float): FeatureRef<T, F> =
modifyAttribute(StrokeAttribute, width)
public fun <T : Any, F : PointsFeature<T>> FeatureRef<T, F>.pointSize(width: Float): FeatureRef<T, F> =
modifyAttribute(StrokeAttribute, width)

View File

@ -3,7 +3,10 @@ package center.sciprog.maps.features
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.*
import androidx.compose.ui.graphics.drawscope.*
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.graphics.painter.Painter
import center.sciprog.attributes.plus
import org.jetbrains.skia.Font
@ -121,7 +124,7 @@ public fun <T : Any> DrawScope.drawFeature(
drawPoints(
points = points,
color = color,
strokeWidth = feature.attributes[StrokeAttribute] ?: Stroke.HairlineWidth,
strokeWidth = feature.attributes[StrokeAttribute] ?: 5f,
pointMode = PointMode.Points,
pathEffect = feature.attributes[PathEffectAttribute],
alpha = alpha