File tree 4 files changed +48
-3
lines changed
locus-api-core/src/main/java/locus/api/objects/styles
4 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
5
5
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## [ 0.9.59] - 2024-09-19
8
+ ### Fixed
9
+ - restored missing ` getCoords ` method of ` HotSpot `
10
+
7
11
## [ 0.9.58] - 2024-09-19
8
12
### Changed
9
13
- rename of ` HotSpot ` object (from ` KmlVec2 ` ) & optimization in it's usage
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Library for [Locus Map](https://www.locusmap.app) application for Android device
16
16
17
17
## Current version
18
18
19
- Latest stable LT version: ** 0.9.58 **
19
+ Latest stable LT version: ** 0.9.59 **
20
20
Available versions on the maven repository: [ here] ( https://repo1.maven.org/maven2/com/asamm/ ) .
21
21
22
22
How to ** update to new 0.9.x** version? More about it [ here] ( https://github.com/asamm/locus-api/wiki/Update-to-version-0.9.0 ) .
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ GRADLE_NEXUS_STAGING = 0.30.0
23
23
LOCUS_LOGGER = 2.2
24
24
25
25
# Version
26
- API_CODE = 105
27
- API_VERSION = 0.9.58
26
+ API_CODE = 106
27
+ API_VERSION = 0.9.59
28
28
29
29
# ANDROID SUPPORT LIBS
30
30
# https://developer.android.com/topic/libraries/support-library/revisions.html
Original file line number Diff line number Diff line change @@ -14,6 +14,47 @@ data class HotSpot(
14
14
FRACTION , PIXELS , INSET_PIXELS
15
15
}
16
16
17
+ /* *
18
+ * Compute reference coordinates of certain image based on the defined hotSpot parameters.
19
+ */
20
+ fun HotSpot.getCoords (sourceWidth : Double , sourceHeight : Double , result : DoubleArray? = DoubleArray (2)): DoubleArray {
21
+ var resultNew = result
22
+
23
+ // check container for results
24
+ if (resultNew == null || resultNew.size != 2 ) {
25
+ resultNew = DoubleArray (2 )
26
+ }
27
+
28
+ // set X units
29
+ when (xUnits) {
30
+ Units .FRACTION -> {
31
+ resultNew[0 ] = sourceWidth * x
32
+ }
33
+ Units .PIXELS -> {
34
+ resultNew[0 ] = x
35
+ }
36
+ Units .INSET_PIXELS -> {
37
+ resultNew[0 ] = sourceWidth - x
38
+ }
39
+ }
40
+
41
+ // set Y units
42
+ when (yUnits) {
43
+ Units .FRACTION -> {
44
+ resultNew[1 ] = sourceHeight * (1.0 - y)
45
+ }
46
+ Units .PIXELS -> {
47
+ resultNew[1 ] = sourceHeight - y
48
+ }
49
+ Units .INSET_PIXELS -> {
50
+ resultNew[1 ] = y
51
+ }
52
+ }
53
+
54
+ // return result
55
+ return resultNew
56
+ }
57
+
17
58
companion object {
18
59
19
60
val HOT_STOP_BOTTOM_CENTER = HotSpot (
You can’t perform that action at this time.
0 commit comments