diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8e7aaa44..3895b1a45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release build artifacts to Maven Central on: release: types: [created] + workflow_dispatch: jobs: publish: diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f2fa9ae..60a6a90ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.1] + +### Fixed + +- PieChart hole content padding being calculated incorrectly + ## [0.9.0] ### Added diff --git a/README.md b/README.md index 3a97fb595..406ee9301 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Maven Central](https://img.shields.io/maven-central/v/io.github.koalaplot/koalaplot-core?color=278ec7)](https://central.sonatype.com/artifact/io.github.koalaplot/koalaplot-core) [![Kotlin](https://img.shields.io/badge/kotlin-2.1.0-278ec7.svg?logo=kotlin)](http://kotlinlang.org) -[![Dokka docs](https://img.shields.io/badge/docs-dokka-278ec7)](https://koalaplot.github.io/koalaplot-core/api/0.9.0/) +[![Dokka docs](https://img.shields.io/badge/docs-dokka-278ec7)](https://koalaplot.github.io/koalaplot-core/api/0.9.1/) [![License MIT](https://img.shields.io/badge/license-MIT-278ec7.svg)](https://github.com/KoalaPlot/koalaplot-core/tree/main/LICENSE.txt) # Koala Plot @@ -75,7 +75,7 @@ repositories { ```kotlin dependencies { - implementation("io.github.koalaplot:koalaplot-core:0.9.0") + implementation("io.github.koalaplot:koalaplot-core:0.9.1") } ``` @@ -106,8 +106,8 @@ BulletGraphs { # Documentation -- [Latest build](https://koalaplot.github.io/koalaplot-core/api/0.9.0) -- [Release 0.9.0](https://koalaplot.github.io/koalaplot-core/api/0.9.0) +- [Latest build](https://koalaplot.github.io/koalaplot-core/api/0.9.1) +- [Release 0.9.1](https://koalaplot.github.io/koalaplot-core/api/0.9.1) Also see the [sample repository](https://github.com/KoalaPlot/koalaplot-samples) for code examples. diff --git a/build.gradle.kts b/build.gradle.kts index 9f94b3206..89dbd4d36 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { } group = "io.github.koalaplot" -version = "0.9.0" +version = "0.9.1" kotlin { explicitApi() diff --git a/convention-plugins/src/main/kotlin/convention.publication.gradle.kts b/convention-plugins/src/main/kotlin/convention.publication.gradle.kts index c7a634c6a..ff8e856ca 100644 --- a/convention-plugins/src/main/kotlin/convention.publication.gradle.kts +++ b/convention-plugins/src/main/kotlin/convention.publication.gradle.kts @@ -96,8 +96,8 @@ publishing { nexusPublishing { repositories { sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) stagingProfileId.set(getExtraString("sonatypeStagingProfileId")) username.set(getExtraString("ossrhUsername")) password.set(getExtraString("ossrhPassword")) diff --git a/src/commonMain/kotlin/io/github/koalaplot/core/pie/PieChart.kt b/src/commonMain/kotlin/io/github/koalaplot/core/pie/PieChart.kt index 16d19b3e5..26e1ed960 100644 --- a/src/commonMain/kotlin/io/github/koalaplot/core/pie/PieChart.kt +++ b/src/commonMain/kotlin/io/github/koalaplot/core/pie/PieChart.kt @@ -365,11 +365,11 @@ public fun PieChart( val labelConnectorTranslations = pieMeasurePolicy.computeLabelConnectorScopes(labelPositions, pieDiameter) - val holeDiameter = pieDiameter * holeSize.toDouble() + val holeDiameter = (pieDiameter * holeSize) val holeSafeEdgeLength = circumscribedSquareSize(holeDiameter) val holePlaceable = subcompose("hole") { Box(modifier = Modifier.clip(CircleShape)) { - holeContent(PaddingValues((holeDiameter - holeSafeEdgeLength).toInt().dp)) + holeContent(PaddingValues(((holeDiameter - holeSafeEdgeLength) / 2.0f).toDp())) } }[0].measure(Constraints.fixed(holeDiameter.toInt(), holeDiameter.toInt())) @@ -455,8 +455,7 @@ public fun PieChart( minPieDiameter = minPieDiameter, maxPieDiameter = maxPieDiameter, forceCenteredPie = forceCenteredPie, - startAnimationUseCase = - StartAnimationUseCase( + startAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, pieAnimationSpec, labelAnimationSpec, diff --git a/src/commonMain/kotlin/io/github/koalaplot/core/util/Geometry.kt b/src/commonMain/kotlin/io/github/koalaplot/core/util/Geometry.kt index df85a5442..f4f80fe7a 100644 --- a/src/commonMain/kotlin/io/github/koalaplot/core/util/Geometry.kt +++ b/src/commonMain/kotlin/io/github/koalaplot/core/util/Geometry.kt @@ -163,8 +163,8 @@ internal fun y2theta(y: Float, radius: Float): Pair { /** * Returns the edge-length of a square circumscribed by a circle with the provided [diameter]. */ -internal fun circumscribedSquareSize(diameter: Double): Double { - return diameter / sqrt(2.0) +internal fun circumscribedSquareSize(diameter: Float): Float { + return diameter / sqrt(2.0f) } internal fun Path.moveTo(offset: Offset) {