Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kotlin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to the JujubaSVG Kotlin/Android library.

---

## 1.4.2

### Added
- `rootCoordinate` property to `NodeInfo` — provides root/window-level click coordinates via `event.x`/`event.y` alongside element-relative coordinates ([#112](https://github.com/CodandoTV/jujubaSVG/pull/112))

---

## 1.4.1

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ public object Const {
const x = boundingClientRect.x
const y = boundingClientRect.y

window.kmpJsBridge.callNative("onElementClicked",JSON.stringify({paramId: id, paramX: x, paramY: y}),
window.kmpJsBridge.callNative(
"onElementClicked",
JSON.stringify(
{paramId: id, paramX: x, paramY: y, rootX: event.x, rootY: event.y}
),
function (data) {
console.log(event.target.id)
}
);
);
}
""";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ internal data class NodeClicked(

@SerialName("paramY")
val y: Float,

@SerialName("rootX")
val rootX: Float,

@SerialName("rootY")
val rootY: Float,
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ internal class OnClickedJSMessageHandler(
coordinate = NodeCoordinate(
x = nodeClicked.x,
y = nodeClicked.y
),
rootCoordinate = NodeCoordinate(
x = nodeClicked.rootX,
y = nodeClicked.rootY,
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ import androidx.compose.runtime.Stable
data class NodeInfo(
val id: String,
val coordinate: NodeCoordinate,
val rootCoordinate: NodeCoordinate,
)
2 changes: 1 addition & 1 deletion kotlin/jujubasvg/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=1.4.1
VERSION=1.4.2
Loading