chore: apply prettier formatting

This commit is contained in:
Nathan Muir
2025-08-19 14:15:14 +12:00
committed by Nathan Muir
parent 4c5572ee23
commit e50a3ea0dc
32 changed files with 611 additions and 1317 deletions

View File

@@ -1413,7 +1413,6 @@ That changes are private and internal specific. They should not break most of `K
Differences from last official `KineticJS` release Differences from last official `KineticJS` release
- Bug Fixes - Bug Fixes
- `strokeScaleEnabled = false` is disabled for text as I can not find a way to implement this - `strokeScaleEnabled = false` is disabled for text as I can not find a way to implement this
- `strokeScaleEnabled = false` for Line now creates a correct hit graph - `strokeScaleEnabled = false` for Line now creates a correct hit graph
- working "this-example" as name for nodes - working "this-example" as name for nodes

View File

@@ -30,7 +30,7 @@ export interface ContainerConfig extends NodeConfig {
* @@containerParams * @@containerParams
*/ */
export abstract class Container< export abstract class Container<
ChildType extends Node = Node ChildType extends Node = Node,
> extends Node<ContainerConfig> { > extends Node<ContainerConfig> {
children: Array<ChildType> = []; children: Array<ChildType> = [];

View File

@@ -46,10 +46,8 @@ type ValidatorFunc<T> = (val: ExtractGetSet<T>, attr: string) => T;
/** /**
* Extracts the "components" (keys) of a GetSet value. The value must be an object. * Extracts the "components" (keys) of a GetSet value. The value must be an object.
*/ */
type ExtractComponents<T extends Constructor, U extends Attr<T>> = Value< type ExtractComponents<T extends Constructor, U extends Attr<T>> =
T, Value<T, U> extends Record<string, any>
U
> extends Record<string, any>
? EnforceString<keyof Value<T, U>>[] ? EnforceString<keyof Value<T, U>>[]
: never; : never;

View File

@@ -188,7 +188,7 @@ function _clearRadialGradientCache(this: Node) {
*}); *});
*/ */
export class Shape< export class Shape<
Config extends ShapeConfig = ShapeConfig Config extends ShapeConfig = ShapeConfig,
> extends Node<Config> { > extends Node<Config> {
_centroid: boolean; _centroid: boolean;
colorKey: string; colorKey: string;

View File

@@ -1100,7 +1100,8 @@ export const Util = {
} }
const maxCornerRadius = radius * Math.cos(Math.PI / sides); const maxCornerRadius = radius * Math.cos(Math.PI / sides);
// cornerRadius creates perfect circle at 1/2 radius // cornerRadius creates perfect circle at 1/2 radius
currCornerRadius = maxCornerRadius * Math.min(1, (currCornerRadius / radius) * 2); currCornerRadius =
maxCornerRadius * Math.min(1, (currCornerRadius / radius) * 2);
const normalVec1 = { x: vec1.x / len1, y: vec1.y / len1 }; const normalVec1 = { x: vec1.x / len1, y: vec1.y / len1 };
const normalVec2 = { x: vec2.x / len2, y: vec2.y / len2 }; const normalVec2 = { x: vec2.x / len2, y: vec2.y / len2 };
const p1 = { const p1 = {
@@ -1118,5 +1119,5 @@ export const Util = {
} }
context.arcTo(curr.x, curr.y, p2.x, p2.y, currCornerRadius); context.arcTo(curr.x, curr.y, p2.x, p2.y, currCornerRadius);
} }
} },
}; };

View File

@@ -2,7 +2,13 @@ import { Factory } from '../Factory';
import { Node, Filter } from '../Node'; import { Node, Filter } from '../Node';
import { getNumberValidator } from '../Validators'; import { getNumberValidator } from '../Validators';
function remap(fromValue: number, fromMin: number, fromMax: number, toMin: number, toMax: number) { function remap(
fromValue: number,
fromMin: number,
fromMax: number,
toMin: number,
toMax: number
) {
// Compute the range of the data // Compute the range of the data
const fromRange = fromMax - fromMin, const fromRange = fromMax - fromMin,
toRange = toMax - toMin; toRange = toMax - toMin;

View File

@@ -116,7 +116,8 @@ const FromPolar = function (src, dst, opt) {
const dx = x - xMid; const dx = x - xMid;
const dy = y - yMid; const dy = y - yMid;
const radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax; const radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
let theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360; let theta =
((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
theta = (theta * tSize) / 360; theta = (theta * tSize) / 360;
x1 = Math.floor(theta); x1 = Math.floor(theta);
y1 = Math.floor(radius); y1 = Math.floor(radius);

View File

@@ -138,7 +138,17 @@ function dilateMask(mask, sw, sh) {
} }
function smoothEdgeMask(mask, sw: number, sh: number) { function smoothEdgeMask(mask, sw: number, sh: number) {
const weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9]; const weights = [
1 / 9,
1 / 9,
1 / 9,
1 / 9,
1 / 9,
1 / 9,
1 / 9,
1 / 9,
1 / 9,
];
const side = Math.round(Math.sqrt(weights.length)); const side = Math.round(Math.sqrt(weights.length));
const halfSide = Math.floor(side / 2); const halfSide = Math.floor(side / 2);

View File

@@ -97,7 +97,7 @@ export interface LineConfig extends ShapeConfig {
*/ */
export class Line< export class Line<
Config extends LineConfig = LineConfig Config extends LineConfig = LineConfig,
> extends Shape<Config> { > extends Shape<Config> {
constructor(config?: Config) { constructor(config?: Config) {
super(config); super(config);

View File

@@ -1,7 +1,10 @@
import { Factory } from '../Factory'; import { Factory } from '../Factory';
import { Shape, ShapeConfig } from '../Shape'; import { Shape, ShapeConfig } from '../Shape';
import { GetSet, Vector2d } from '../types'; import { GetSet, Vector2d } from '../types';
import { getNumberOrArrayOfNumbersValidator, getNumberValidator } from '../Validators'; import {
getNumberOrArrayOfNumbersValidator,
getNumberValidator,
} from '../Validators';
import { _registerNode } from '../Global'; import { _registerNode } from '../Global';
import { Context } from '../Context'; import { Context } from '../Context';
import { Util } from '../Util'; import { Util } from '../Util';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<style> <style>

View File

@@ -1,14 +1,16 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<title>KonvaJS Sandbox</title> <title>KonvaJS Sandbox</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1.0, minimum-scale=1.0, maximum-scale=1.0"> <meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=1.0, minimum-scale=1.0, maximum-scale=1.0"
/>
</head> </head>
<body> <body>
<!-- testing Konva inside iframe --> <!-- testing Konva inside iframe -->
<iframe src="./sandbox.html"></iframe> <iframe src="./sandbox.html"></iframe>
</body> </body>
</html> </html>

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<style> <style>
@@ -66,7 +66,6 @@
count = startBunnyCount; count = startBunnyCount;
counter.innerHTML = startBunnyCount + ' BUNNIES'; counter.innerHTML = startBunnyCount + ' BUNNIES';
canvas.addEventListener('mousedown', function () { canvas.addEventListener('mousedown', function () {
isAdding = true; isAdding = true;
}); });
@@ -84,8 +83,8 @@
x: 10, x: 10,
y: 10, y: 10,
speedX: Math.random() * 10, speedX: Math.random() * 10,
speedY: Math.random() * 10 - 5 speedY: Math.random() * 10 - 5,
} };
bunnys.push(bunny); bunnys.push(bunny);
} }
} }
@@ -108,8 +107,8 @@
x: 10, x: 10,
y: 10, y: 10,
speedX: Math.random() * 10, speedX: Math.random() * 10,
speedY: Math.random() * 10 - 5 speedY: Math.random() * 10 - 5,
} };
bunnys.push(bunny); bunnys.push(bunny);
count++; count++;
} }
@@ -124,21 +123,21 @@
bunny.speedY += gravity; bunny.speedY += gravity;
if (bunny.x > maxX - wabbitTexture.width) { if (bunny.x > maxX - wabbitTexture.width) {
bunny.speedX *= -1; bunny.speedX *= -1;
bunny.x = (maxX - wabbitTexture.width); bunny.x = maxX - wabbitTexture.width;
} else if (bunny.x < minX) { } else if (bunny.x < minX) {
bunny.speedX *= -1; bunny.speedX *= -1;
bunny.x = (minX); bunny.x = minX;
} }
if (bunny.y > maxY - wabbitTexture.height) { if (bunny.y > maxY - wabbitTexture.height) {
bunny.speedY *= -0.85; bunny.speedY *= -0.85;
bunny.y = (maxY - wabbitTexture.height); bunny.y = maxY - wabbitTexture.height;
if (Math.random() > 0.5) { if (Math.random() > 0.5) {
bunny.speedY -= Math.random() * 6; bunny.speedY -= Math.random() * 6;
} }
} else if (bunny.y < minY) { } else if (bunny.y < minY) {
bunny.speedY = 0; bunny.speedY = 0;
bunny.y = (minY); bunny.y = minY;
} }
ctx.save(); ctx.save();
ctx.transform(1, 0, 0, 1, bunny.x, bunny.y); ctx.transform(1, 0, 0, 1, bunny.x, bunny.y);
@@ -146,7 +145,6 @@
ctx.restore(); ctx.restore();
} }
requestAnimationFrame(update); requestAnimationFrame(update);
stats.end(); stats.end();
} }

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<style> <style>

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<style> <style>

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -247,7 +247,6 @@ describe('Arrow', function () {
}); });
layer.add(arrow); layer.add(arrow);
stage.add(layer); stage.add(layer);
var rect = arrow.getClientRect({ skipStroke: true }); var rect = arrow.getClientRect({ skipStroke: true });

View File

@@ -2605,8 +2605,10 @@ describe('Container', function () {
stage.scale({ x: 2, y: 2 }); stage.scale({ x: 2, y: 2 });
stage.draw(); stage.draw();
var data = layer.getHitCanvas().getContext().getImageData(48, 100, 1, 1) var data = layer
.data; .getHitCanvas()
.getContext()
.getImageData(48, 100, 1, 1).data;
var isTransparent = data[3] == 0; var isTransparent = data[3] == 0;
assert.equal( assert.equal(
isTransparent, isTransparent,

View File

@@ -333,230 +333,81 @@ describe('Line', function () {
x: 0, x: 0,
y: 0, y: 0,
points: [ points: [
494.39880507841673, 494.39880507841673, 795.3696788648244, 494.49880507841675,
795.3696788648244, 795.4696788648245, 494.39880507841673, 796.8633308439133,
494.49880507841675, 489.9178491411501, 798.3569828230022, 480.95593726661684,
795.4696788648245, 802.8379387602688, 467.513069454817, 810.3061986557132,
494.39880507841673, 451.0828976848394, 820.7617625093353, 433.15907393577294,
796.8633308439133, 832.7109783420462, 415.2352501867065, 846.1538461538461,
489.9178491411501, 398.8050784167289, 859.596713965646, 383.8685586258402,
798.3569828230022, 871.545929798357, 374.90664675130694, 880.5078416728902,
480.95593726661684, 371.9193427931292, 883.4951456310679, 371.9193427931292,
802.8379387602688, 883.4951456310679, 371.9193427931292, 883.4951456310679,
467.513069454817, 376.40029873039583, 882.0014936519791, 395.8177744585511,
810.3061986557132, 876.0268857356235, 443.6146377893951, 856.6094100074682,
451.0828976848394, 507.84167289021656, 838.6855862584017, 551.1575802837939,
820.7617625093353, 825.2427184466019, 624.3465272591486, 807.3188946975355,
433.15907393577294, 696.0418222554144, 789.395070948469, 758.7752053771471,
832.7109783420462, 777.445855115758, 802.0911127707244, 772.9648991784914,
415.2352501867065, 820.0149365197909, 771.4712471994025, 821.5085884988797,
846.1538461538461, 771.4712471994025, 820.0149365197909, 775.9522031366691,
398.8050784167289, 799.1038088125466, 790.8887229275579, 743.8386855862584,
859.596713965646, 825.2427184466019, 652.7259148618372, 871.545929798357,
383.8685586258402, 542.1956684092606, 926.8110530246452, 455.563853622106,
871.545929798357, 977.5952203136669, 412.24794622852875, 1010.455563853622,
374.90664675130694, 397.31142643764, 1026.8857356235997, 397.31142643764,
880.5078416728902, 1032.8603435399552, 400.29873039581776, 1038.8349514563106,
371.9193427931292, 415.2352501867065, 1043.3159073935774, 463.0321135175504,
883.4951456310679, 1043.3159073935774, 563.1067961165048, 1040.3286034353996,
371.9193427931292, 696.0418222554144, 1032.8603435399552, 787.1545929798357,
883.4951456310679, 1026.8857356235997, 921.5832710978342, 1017.9238237490664,
371.9193427931292, 1018.6706497386109, 1013.4428678117998, 1069.4548170276325,
883.4951456310679, 1013.4428678117998, 1076.923076923077, 1013.4428678117998,
376.40029873039583, 1075.4294249439881, 1014.9365197908887, 1051.530993278566,
882.0014936519791, 1026.8857356235997, 979.8356982823002, 1053.7714712471993,
395.8177744585511, 888.722927557879, 1079.1635548917102, 761.7625093353248,
876.0268857356235, 1116.504854368932, 672.1433905899925, 1150.858849887976,
443.6146377893951, 628.8274831964152, 1171.7699775952203, 615.3846153846154,
856.6094100074682, 1180.7318894697535, 615.3846153846154, 1182.2255414488425,
507.84167289021656, 618.3719193427931, 1183.7191934279313, 633.3084391336819,
838.6855862584017, 1182.2255414488425, 687.0799103808812, 1171.7699775952203,
551.1575802837939, 775.2053771471248, 1150.858849887976, 902.1657953696788,
825.2427184466019, 1116.504854368932, 990.2912621359224, 1091.1127707244211,
624.3465272591486, 1082.8976848394325, 1062.7333831217327, 1133.681852128454,
807.3188946975355, 1046.303211351755, 1144.1374159820762, 1041.8222554144884,
696.0418222554144, 1144.1374159820762, 1041.8222554144884, 1141.1501120238984,
789.395070948469, 1041.8222554144884, 1117.2516803584765, 1043.3159073935774,
758.7752053771471, 1082.8976848394325, 1046.303211351755, 1008.2150858849888,
777.445855115758, 1062.7333831217327, 917.1023151605675, 1092.6064227035101,
802.0911127707244, 861.8371919342793, 1117.9985063480208, 814.0403286034353,
772.9648991784914, 1152.352501867065, 794.62285287528, 1176.250933532487,
820.0149365197909, 790.1418969380135, 1189.6938013442868, 793.1292008961912,
771.4712471994025, 1198.65571321882, 802.0911127707244, 1206.1239731142643,
821.5085884988797, 831.9641523525019, 1216.5795369678865, 903.6594473487677,
771.4712471994025, 1225.5414488424196, 1014.1896938013442, 1228.5287528005974,
820.0149365197909, 1148.6183719193427, 1228.5287528005974, 1272.591486183719,
775.9522031366691, 1225.5414488424196, 1314.4137415982075, 1225.5414488424196,
799.1038088125466, 1326.3629574309186, 1225.5414488424196, 1326.3629574309186,
790.8887229275579, 1225.5414488424196, 1314.4137415982075, 1228.5287528005974,
743.8386855862584, 1272.591486183719, 1237.4906646751306, 1197.9088872292755,
825.2427184466019, 1247.9462285287527, 1105.3024645257656, 1270.3510082150858,
652.7259148618372, 1048.5436893203882, 1286.7811799850635, 1024.6452576549664,
871.545929798357, 1295.7430918595967, 1006.7214339058999, 1306.1986557132188,
542.1956684092606, 1000.7468259895444, 1313.6669156086632, 1000.7468259895444,
926.8110530246452, 1315.160567587752, 1003.7341299477222, 1316.6542195668408,
455.563853622106, 1015.6833457804331, 1319.6415235250186, 1050.0373412994772,
977.5952203136669, 1321.1351755041076, 1103.8088125466766, 1321.1351755041076,
412.24794622852875, 1169.529499626587, 1316.6542195668408, 1220.3136669156086,
1010.455563853622, 1310.6796116504854, 1248.6930545182972, 1307.6923076923076,
397.31142643764, 1253.1740104555638, 1307.6923076923076, 1253.1740104555638,
1026.8857356235997, 1307.6923076923076, 1253.1740104555638, 1307.6923076923076,
397.31142643764, 1248.6930545182972, 1309.1859596713964, 1229.275578790142,
1032.8603435399552, 1312.1732636295742, 1199.4025392083645, 1319.6415235250186,
400.29873039581776, 1172.5168035847648, 1330.0970873786407, 1154.5929798356983,
1038.8349514563106, 1342.0463032113516, 1144.1374159820762, 1353.9955190440626,
415.2352501867065, 1139.6564600448096, 1361.463778939507, 1138.1628080657206,
1043.3159073935774, 1364.4510828976847, 1138.1628080657206, 1365.9447348767737,
463.0321135175504, 1138.1628080657206, 1365.9447348767737,
1043.3159073935774,
563.1067961165048,
1040.3286034353996,
696.0418222554144,
1032.8603435399552,
787.1545929798357,
1026.8857356235997,
921.5832710978342,
1017.9238237490664,
1018.6706497386109,
1013.4428678117998,
1069.4548170276325,
1013.4428678117998,
1076.923076923077,
1013.4428678117998,
1075.4294249439881,
1014.9365197908887,
1051.530993278566,
1026.8857356235997,
979.8356982823002,
1053.7714712471993,
888.722927557879,
1079.1635548917102,
761.7625093353248,
1116.504854368932,
672.1433905899925,
1150.858849887976,
628.8274831964152,
1171.7699775952203,
615.3846153846154,
1180.7318894697535,
615.3846153846154,
1182.2255414488425,
618.3719193427931,
1183.7191934279313,
633.3084391336819,
1182.2255414488425,
687.0799103808812,
1171.7699775952203,
775.2053771471248,
1150.858849887976,
902.1657953696788,
1116.504854368932,
990.2912621359224,
1091.1127707244211,
1082.8976848394325,
1062.7333831217327,
1133.681852128454,
1046.303211351755,
1144.1374159820762,
1041.8222554144884,
1144.1374159820762,
1041.8222554144884,
1141.1501120238984,
1041.8222554144884,
1117.2516803584765,
1043.3159073935774,
1082.8976848394325,
1046.303211351755,
1008.2150858849888,
1062.7333831217327,
917.1023151605675,
1092.6064227035101,
861.8371919342793,
1117.9985063480208,
814.0403286034353,
1152.352501867065,
794.62285287528,
1176.250933532487,
790.1418969380135,
1189.6938013442868,
793.1292008961912,
1198.65571321882,
802.0911127707244,
1206.1239731142643,
831.9641523525019,
1216.5795369678865,
903.6594473487677,
1225.5414488424196,
1014.1896938013442,
1228.5287528005974,
1148.6183719193427,
1228.5287528005974,
1272.591486183719,
1225.5414488424196,
1314.4137415982075,
1225.5414488424196,
1326.3629574309186,
1225.5414488424196,
1326.3629574309186,
1225.5414488424196,
1314.4137415982075,
1228.5287528005974,
1272.591486183719,
1237.4906646751306,
1197.9088872292755,
1247.9462285287527,
1105.3024645257656,
1270.3510082150858,
1048.5436893203882,
1286.7811799850635,
1024.6452576549664,
1295.7430918595967,
1006.7214339058999,
1306.1986557132188,
1000.7468259895444,
1313.6669156086632,
1000.7468259895444,
1315.160567587752,
1003.7341299477222,
1316.6542195668408,
1015.6833457804331,
1319.6415235250186,
1050.0373412994772,
1321.1351755041076,
1103.8088125466766,
1321.1351755041076,
1169.529499626587,
1316.6542195668408,
1220.3136669156086,
1310.6796116504854,
1248.6930545182972,
1307.6923076923076,
1253.1740104555638,
1307.6923076923076,
1253.1740104555638,
1307.6923076923076,
1253.1740104555638,
1307.6923076923076,
1248.6930545182972,
1309.1859596713964,
1229.275578790142,
1312.1732636295742,
1199.4025392083645,
1319.6415235250186,
1172.5168035847648,
1330.0970873786407,
1154.5929798356983,
1342.0463032113516,
1144.1374159820762,
1353.9955190440626,
1139.6564600448096,
1361.463778939507,
1138.1628080657206,
1364.4510828976847,
1138.1628080657206,
1365.9447348767737,
1138.1628080657206,
1365.9447348767737,
], ],
tension: 0.5, tension: 0.5,
stroke: '#0f0', stroke: '#0f0',

View File

@@ -16,56 +16,12 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
kicking: [ kicking: [
0, 0, 109, 45, 98, 45, 109, 45, 98, 95, 109, 63, 98, 156, 109, 70, 98,
109, 229, 109, 60, 98, 287, 109, 41, 98,
45,
98,
45,
109,
45,
98,
95,
109,
63,
98,
156,
109,
70,
98,
229,
109,
60,
98,
287,
109,
41,
98,
], ],
}, },
frameRate: 10, frameRate: 10,
@@ -118,30 +74,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 5, frameRate: 5,
@@ -185,30 +119,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 5, frameRate: 5,
@@ -221,30 +133,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 20, frameRate: 20,
@@ -285,30 +175,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 50, frameRate: 50,
@@ -341,30 +209,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 50, frameRate: 50,
@@ -407,30 +253,8 @@ describe('Sprite', function () {
animation: 'standing', animation: 'standing',
animations: { animations: {
standing: [ standing: [
0, 0, 0, 49, 109, 52, 0, 49, 109, 105, 0, 49, 109, 158, 0, 49, 109,
0, 210, 0, 49, 109, 262, 0, 49, 109,
49,
109,
52,
0,
49,
109,
105,
0,
49,
109,
158,
0,
49,
109,
210,
0,
49,
109,
262,
0,
49,
109,
], ],
}, },
frameRate: 50, frameRate: 50,

View File

@@ -3680,7 +3680,7 @@ describe('Transformer', function () {
layer.draw(); layer.draw();
var rect = Konva.Util._assign({}, tr._getNodeRect()); var rect = Konva.Util._assign({}, tr._getNodeRect());
delete rect.rotation; delete rect.rotation;
assert.deepEqual(shape.getClientRect(), rect), 'change width'; (assert.deepEqual(shape.getClientRect(), rect), 'change width');
shape.height(30); shape.height(30);
layer.draw(); layer.draw();
@@ -3726,7 +3726,7 @@ describe('Transformer', function () {
layer.draw(); layer.draw();
var rect = Konva.Util._assign({}, tr._getNodeRect()); var rect = Konva.Util._assign({}, tr._getNodeRect());
delete rect.rotation; delete rect.rotation;
assert.deepEqual(shape.getClientRect(), rect), 'change data'; (assert.deepEqual(shape.getClientRect(), rect), 'change data');
}); });
it('make sure transformer events are not cloned', function () { it('make sure transformer events are not cloned', function () {

View File

@@ -17,8 +17,7 @@
"skipLibCheck": true, "skipLibCheck": true,
// probably we would never enable this one // probably we would never enable this one
// because it's too strict, konva generates many functions on the runtime // because it's too strict, konva generates many functions on the runtime
"strictPropertyInitialization": false, "strictPropertyInitialization": false
}, },
"include": ["./src/**/*.ts"], "include": ["./src/**/*.ts"]
} }