Skip to content

Commit d107afe

Browse files
author
farfromrefug
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/ui-canvas/index.android.ts
2 parents 874fef8 + 5365bef commit d107afe

File tree

13 files changed

+62
-19
lines changed

13 files changed

+62
-19
lines changed

docs/assets/hierarchy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ui-canvas/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [4.6.41](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-07-02)
7+
8+
**Note:** Version bump only for package @nativescript-community/ui-canvas
9+
10+
## [4.6.40](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-06-29)
11+
12+
**Note:** Version bump only for package @nativescript-community/ui-canvas
13+
14+
## [4.6.39](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-01-02)
15+
16+
**Note:** Version bump only for package @nativescript-community/ui-canvas
17+
618
## [4.6.38](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2024-12-18)
719

820
**Note:** Version bump only for package @nativescript-community/ui-canvas

packages/ui-canvas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript-community/ui-canvas",
3-
"version": "4.6.38",
3+
"version": "4.6.41",
44
"description": "Implement Canvas into your NativeScript apps.",
55
"main": "./index",
66
"sideEffects": false,

packages/ui-canvaslabel/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.2.44](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-07-02)
7+
8+
**Note:** Version bump only for package @nativescript-community/ui-canvaslabel
9+
10+
## [1.2.43](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-06-29)
11+
12+
**Note:** Version bump only for package @nativescript-community/ui-canvaslabel
13+
14+
## [1.2.42](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-01-02)
15+
16+
**Note:** Version bump only for package @nativescript-community/ui-canvaslabel
17+
618
## [1.2.41](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2024-12-18)
719

820
**Note:** Version bump only for package @nativescript-community/ui-canvaslabel

packages/ui-canvaslabel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript-community/ui-canvaslabel",
3-
"version": "1.2.41",
3+
"version": "1.2.44",
44
"description": "Alternative to the built-in NativeScript Label but uses canvas which allows extreme complexity and customization.",
55
"main": "./canvaslabel",
66
"sideEffects": false,

packages/ui-svg/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.2.13](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-07-02)
7+
8+
**Note:** Version bump only for package @nativescript-community/ui-svg
9+
10+
## [0.2.12](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-06-29)
11+
12+
**Note:** Version bump only for package @nativescript-community/ui-svg
13+
14+
## [0.2.11](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2025-01-02)
15+
16+
**Note:** Version bump only for package @nativescript-community/ui-svg
17+
618
## [0.2.10](https://github.com/nativescript-community/ui-canvas/compare/@nativescript-community/[email protected]...@nativescript-community/[email protected]) (2024-12-18)
719

820
**Note:** Version bump only for package @nativescript-community/ui-svg

packages/ui-svg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript-community/ui-svg",
3-
"version": "0.2.10",
3+
"version": "0.2.13",
44
"description": "Adds support for SVGs in your NativeScript apps.",
55
"main": "./index",
66
"sideEffects": false,

src/ui-canvas/canvas.android.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ function createColorParam(param) {
3333
function drawViewOnCanvas(canvas: android.graphics.Canvas, view: View, rect?: android.graphics.Rect) {
3434
if (!view.nativeView) {
3535
const activity = Application.android.foregroundActivity;
36-
(view as any)._setupAsRootView(activity);
37-
(view as any)._isAddedToNativeVisualTree = true;
38-
(view as any).callLoaded();
36+
view._setupAsRootView(activity);
37+
view._isAddedToNativeVisualTree = true;
38+
view.callLoaded();
3939
}
4040
if (view.nativeView) {
4141
if (rect) {
@@ -46,7 +46,7 @@ function drawViewOnCanvas(canvas: android.graphics.Canvas, view: View, rect?: an
4646
canvas.save();
4747
canvas.translate(rect.left, rect.top);
4848
}
49-
view.nativeView.draw(canvas as any);
49+
view.nativeView.draw(canvas);
5050
if (rect) {
5151
canvas.restore();
5252
}
@@ -192,6 +192,13 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
192192
super();
193193
if (paint) {
194194
this.mNative = new android.graphics.Paint(paint.getNative());
195+
//we need to clone the typeface or it is shared
196+
const original = this.mNative.getTypeface();
197+
if (original) {
198+
const style = original.getStyle();
199+
const cloned = android.graphics.Typeface.create(original, style);
200+
this.mNative.setTypeface(cloned);
201+
}
195202
} else {
196203
this.mNative = new android.graphics.Paint(1); //android.graphics.Paint.ANTI_ALIAS_FLAG
197204
}
@@ -287,7 +294,7 @@ export class Paint extends ProxyClass<android.graphics.Paint> {
287294
}
288295
}
289296
set color(color) {
290-
(this as any).setColor(color);
297+
this['setColor'](color);
291298
}
292299
set strokeWidth(value: number) {
293300
this.mNative.setStrokeWidth(value);

0 commit comments

Comments
 (0)