Skip to content

Commit 0ee2ff7

Browse files
committed
fix: correclty handle color property change
1 parent 635bece commit 0ee2ff7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: src/canvas.common.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangedData, Observable, ObservableArray, Property, Screen, View, booleanConverter } from '@nativescript/core';
1+
import { ChangedData, Observable, ObservableArray, Property, Screen, View, booleanConverter, colorProperty } from '@nativescript/core';
22
import { layout } from '@nativescript/core/utils/utils';
33
import { Canvas, Rect, RectF } from './canvas';
44
import Shape from './shapes/shape';
@@ -161,6 +161,12 @@ export abstract class CanvasBase extends View {
161161
shape.off(Observable.propertyChangeEvent, this.onShapePropertyChange, this);
162162
}
163163

164+
[colorProperty.setNative](value) {
165+
if (!!this._shapes) {
166+
this.requestDrawShapes();
167+
}
168+
}
169+
164170
[densityProperty.setNative](value) {
165171
if (!!this._shapes) {
166172
this.requestDrawShapes();

Diff for: src/canvas.ios.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,7 @@ export class Paint implements IPaint {
11061106
} else {
11071107
this.alpha = 255;
11081108
}
1109+
this._textAttribs = null;
11091110
}
11101111
getColor(): Color {
11111112
return this._color;

0 commit comments

Comments
 (0)