Skip to content

Commit

Permalink
chore: remove autoScale
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Mar 11, 2024
1 parent 323a2b0 commit f9193d2
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/canvas-babylon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-babylon",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-media/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-media",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Canvas media",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-phaser-ce/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser-ce",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Tools for using Phaser-ce to build native 2D games in NativeScript 👾",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-phaser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Build awesome 2D games with Phaser.js and NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-pixi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-pixi",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Plugin for using pixi.js in NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-polyfill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-polyfill",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Polyfill for making NativeScript compatible with web libs like pixi.js, three.js, phaser.js, babylon.js, etc....",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-three/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-three",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "Utilities for using THREE.js on NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
8 changes: 0 additions & 8 deletions packages/canvas/Canvas/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ class Rectangle {
}
}

export const autoScaleProperty = new Property<CanvasBase, boolean>({
name: 'autoScale',
defaultValue: true,
valueConverter: booleanConverter,
});

export const ignoreTouchEventsProperty = new Property<CanvasBase, boolean>({
name: 'ignoreTouchEvents',
Expand All @@ -360,7 +355,6 @@ export const doc = {
@CSSType('Canvas')
export abstract class CanvasBase extends View implements ICanvasBase {
public static readyEvent = 'ready';
autoScale: boolean;
ignoreTouchEvents: boolean;
_isCustom: boolean = false;
_classList: Set<any>;
Expand Down Expand Up @@ -1124,5 +1118,3 @@ export abstract class CanvasBase extends View implements ICanvasBase {

releasePointerCapture(id) {}
}

autoScaleProperty.register(CanvasBase);
8 changes: 2 additions & 6 deletions packages/canvas/Canvas/index.android.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CanvasBase, doc, autoScaleProperty, ignoreTouchEventsProperty, DOMRect } from './common';
import { CanvasBase, doc, ignoreTouchEventsProperty, DOMRect } from './common';
import { DOMMatrix } from '../Canvas2D';
import { CanvasRenderingContext2D } from '../Canvas2D/CanvasRenderingContext2D';
import { WebGLRenderingContext } from '../WebGL/WebGLRenderingContext';
Expand Down Expand Up @@ -72,12 +72,8 @@ export class Canvas extends CanvasBase {
}
}

[autoScaleProperty.setNative](value: boolean) {
this._canvas.setAutoScale(value);
}

[ignoreTouchEventsProperty.setNative](value: boolean) {
this._canvas.setIgnoreTouchEvents = value;
this._canvas.setIgnoreTouchEvents(value);
}

// @ts-ignore
Expand Down
8 changes: 6 additions & 2 deletions packages/canvas/Canvas/index.ios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CanvasBase, doc, ignoreTouchEventsProperty, DOMRect, autoScaleProperty } from './common';
import { CanvasBase, doc, ignoreTouchEventsProperty, DOMRect } from './common';
import { DOMMatrix } from '../Canvas2D';
import { CanvasRenderingContext2D } from '../Canvas2D/CanvasRenderingContext2D';
import { WebGLRenderingContext } from '../WebGL/WebGLRenderingContext';
Expand Down Expand Up @@ -96,7 +96,11 @@ export class Canvas extends CanvasBase {
};
}
}
qqq;

[ignoreTouchEventsProperty.setNative](value: boolean) {
this._canvas.ignoreTouchEvents = value;
}

// @ts-ignore
get ios() {
return this._canvas;
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.15",
"description": "DOM Canvas API for NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion packages/canvas/src-native/canvas-android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

0 comments on commit f9193d2

Please sign in to comment.