@quinninc/pixi-transformer 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Transformer.js +14 -4
- package/package.json +1 -1
package/dist/Transformer.js
CHANGED
|
@@ -93,9 +93,10 @@ export class Transformer extends Pixi.Container {
|
|
|
93
93
|
alpha: this.handleOpacity * 0.75,
|
|
94
94
|
});
|
|
95
95
|
this.addChild(this.fromPoint, this.toPoint);
|
|
96
|
-
const edgeLong = Math.round(this.controlsSize * 1.
|
|
97
|
-
const edgeShort = Math.round(this.controlsSize * 0.
|
|
96
|
+
const edgeLong = Math.round(this.controlsSize * 1.4);
|
|
97
|
+
const edgeShort = Math.round(this.controlsSize * 0.55);
|
|
98
98
|
const edgeRadius = Math.max(6, Math.round(edgeShort / 2));
|
|
99
|
+
const cornerSize = Math.round(this.controlsSize * 1.1);
|
|
99
100
|
// scaling handles
|
|
100
101
|
this.scaleTHandle = this.createHandle({
|
|
101
102
|
name: "scaleTHandle",
|
|
@@ -129,29 +130,37 @@ export class Transformer extends Pixi.Container {
|
|
|
129
130
|
name: "scaleTLHandle",
|
|
130
131
|
cursor: "nw-resize",
|
|
131
132
|
shape: "circle",
|
|
133
|
+
width: cornerSize,
|
|
134
|
+
height: cornerSize,
|
|
132
135
|
});
|
|
133
136
|
this.scaleTRHandle = this.createHandle({
|
|
134
137
|
name: "scaleTRHandle",
|
|
135
138
|
cursor: "ne-resize",
|
|
136
139
|
shape: "circle",
|
|
140
|
+
width: cornerSize,
|
|
141
|
+
height: cornerSize,
|
|
137
142
|
});
|
|
138
143
|
this.scaleBRHandle = this.createHandle({
|
|
139
144
|
name: "scaleBRHandle",
|
|
140
145
|
cursor: "se-resize",
|
|
141
146
|
shape: "circle",
|
|
147
|
+
width: cornerSize,
|
|
148
|
+
height: cornerSize,
|
|
142
149
|
});
|
|
143
150
|
this.scaleBLHandle = this.createHandle({
|
|
144
151
|
name: "scaleBLHandle",
|
|
145
152
|
cursor: "sw-resize",
|
|
146
153
|
shape: "circle",
|
|
154
|
+
width: cornerSize,
|
|
155
|
+
height: cornerSize,
|
|
147
156
|
});
|
|
148
157
|
// rotation handle
|
|
149
158
|
this.rotateHandle = this.createHandle({
|
|
150
159
|
name: "Rotate",
|
|
151
160
|
cursor: "pointer",
|
|
152
161
|
shape: "circle",
|
|
153
|
-
width: Math.round(this.controlsSize * 0.
|
|
154
|
-
height: Math.round(this.controlsSize * 0.
|
|
162
|
+
width: Math.round(this.controlsSize * 0.85),
|
|
163
|
+
height: Math.round(this.controlsSize * 0.85),
|
|
155
164
|
});
|
|
156
165
|
this.addChild(this.scaleTHandle, this.scaleRHandle, this.scaleBHandle, this.scaleLHandle, this.scaleTLHandle, this.scaleTRHandle, this.scaleBRHandle, this.scaleBLHandle, this.rotateHandle);
|
|
157
166
|
// ------------<MoveTool>---------------
|
|
@@ -165,6 +174,7 @@ export class Transformer extends Pixi.Container {
|
|
|
165
174
|
this.handleHandleEvents(this.moveHandle, this);
|
|
166
175
|
this.moveHandle.hitArea = new Pixi.Rectangle(0, 0, this.controlsSize, this.controlsSize);
|
|
167
176
|
this.addChild(this.moveHandle);
|
|
177
|
+
this.setChildIndex(this.moveHandle, 0);
|
|
168
178
|
function changeAnchorPoint(ev) {
|
|
169
179
|
if (!that.pivotKey)
|
|
170
180
|
return;
|