Skip to content

Commit e50a3ea

Browse files
committed
chore: apply prettier formatting
1 parent 4c5572e commit e50a3ea

32 files changed

+611
-1317
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,6 @@ That changes are private and internal specific. They should not break most of `K
14131413
Differences from last official `KineticJS` release
14141414
14151415
- Bug Fixes
1416-
14171416
- `strokeScaleEnabled = false` is disabled for text as I can not find a way to implement this
14181417
- `strokeScaleEnabled = false` for Line now creates a correct hit graph
14191418
- working "this-example" as name for nodes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ At the current moment `Konva` doesn't work in IE11 directly. To make it work you
6666

6767
# Debugging
6868

69-
The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool.
69+
The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool.
7070

7171
# Loading and installing Konva
7272

resources/jsdoc.conf.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"path" : "ink-docstrap",
3-
"tags" : {
4-
"allowUnknownTags" : true
5-
},
6-
"plugins" : ["plugins/markdown"],
2+
"path": "ink-docstrap",
3+
"tags": {
4+
"allowUnknownTags": true
5+
},
6+
"plugins": ["plugins/markdown"],
77

8-
"templates" : {
9-
"cleverLinks" : false,
10-
"monospaceLinks" : false,
11-
"dateFormat" : "ddd MMM Do YYYY",
12-
"outputSourceFiles" : true,
13-
"outputSourcePath" : true,
14-
"systemName" : "Konva",
15-
"footer" : "",
16-
"copyright" : "Konva Copyright © 2015 The contributors to the Konva project.",
17-
"navType" : "vertical",
18-
"theme" : "cosmo",
19-
"linenums" : true,
20-
"collapseSymbols" : false,
21-
"inverseNav" : true,
22-
"highlightTutorialCode" : true
23-
},
24-
"markdown" : {
25-
"parser" : "gfm",
26-
"hardwrap" : true
27-
}
8+
"templates": {
9+
"cleverLinks": false,
10+
"monospaceLinks": false,
11+
"dateFormat": "ddd MMM Do YYYY",
12+
"outputSourceFiles": true,
13+
"outputSourcePath": true,
14+
"systemName": "Konva",
15+
"footer": "",
16+
"copyright": "Konva Copyright © 2015 The contributors to the Konva project.",
17+
"navType": "vertical",
18+
"theme": "cosmo",
19+
"linenums": true,
20+
"collapseSymbols": false,
21+
"inverseNav": true,
22+
"highlightTutorialCode": true
23+
},
24+
"markdown": {
25+
"parser": "gfm",
26+
"hardwrap": true
27+
}
2828
}

src/Container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface ContainerConfig extends NodeConfig {
3030
* @@containerParams
3131
*/
3232
export abstract class Container<
33-
ChildType extends Node = Node
33+
ChildType extends Node = Node,
3434
> extends Node<ContainerConfig> {
3535
children: Array<ChildType> = [];
3636

src/Factory.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@ type ValidatorFunc<T> = (val: ExtractGetSet<T>, attr: string) => T;
4646
/**
4747
* Extracts the "components" (keys) of a GetSet value. The value must be an object.
4848
*/
49-
type ExtractComponents<T extends Constructor, U extends Attr<T>> = Value<
50-
T,
51-
U
52-
> extends Record<string, any>
53-
? EnforceString<keyof Value<T, U>>[]
54-
: never;
49+
type ExtractComponents<T extends Constructor, U extends Attr<T>> =
50+
Value<T, U> extends Record<string, any>
51+
? EnforceString<keyof Value<T, U>>[]
52+
: never;
5553

5654
export const Factory = {
5755
addGetterSetter<T extends Constructor, U extends Attr<T>>(

src/Global.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export const glob: any =
3030
typeof global !== 'undefined'
3131
? global
3232
: typeof window !== 'undefined'
33-
? window
34-
: typeof WorkerGlobalScope !== 'undefined'
35-
? self
36-
: {};
33+
? window
34+
: typeof WorkerGlobalScope !== 'undefined'
35+
? self
36+
: {};
3737

3838
export const Konva = {
3939
_global: glob,

src/Shape.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function _clearRadialGradientCache(this: Node) {
188188
*});
189189
*/
190190
export class Shape<
191-
Config extends ShapeConfig = ShapeConfig
191+
Config extends ShapeConfig = ShapeConfig,
192192
> extends Node<Config> {
193193
_centroid: boolean;
194194
colorKey: string;

src/Util.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,16 +1068,16 @@ export const Util = {
10681068
);
10691069
context.lineTo(xOrigin, yOrigin + topLeft);
10701070
context.arc(
1071-
xOrigin + topLeft,
1072-
yOrigin + topLeft,
1073-
topLeft,
1074-
Math.PI,
1075-
(Math.PI * 3) / 2,
1076-
false
1071+
xOrigin + topLeft,
1072+
yOrigin + topLeft,
1073+
topLeft,
1074+
Math.PI,
1075+
(Math.PI * 3) / 2,
1076+
false
10771077
);
10781078
},
10791079
drawRoundedPolygonPath(
1080-
context: Context,
1080+
context: Context,
10811081
points: Vector2d[],
10821082
sides: number,
10831083
radius: number,
@@ -1088,8 +1088,8 @@ export const Util = {
10881088
const prev = points[(i - 1 + sides) % sides];
10891089
const curr = points[i];
10901090
const next = points[(i + 1) % sides];
1091-
const vec1 = {x: curr.x - prev.x, y: curr.y - prev.y};
1092-
const vec2 = {x: next.x - curr.x, y: next.y - curr.y};
1091+
const vec1 = { x: curr.x - prev.x, y: curr.y - prev.y };
1092+
const vec2 = { x: next.x - curr.x, y: next.y - curr.y };
10931093
const len1 = Math.hypot(vec1.x, vec1.y);
10941094
const len2 = Math.hypot(vec2.x, vec2.y);
10951095
let currCornerRadius;
@@ -1100,9 +1100,10 @@ export const Util = {
11001100
}
11011101
const maxCornerRadius = radius * Math.cos(Math.PI / sides);
11021102
// cornerRadius creates perfect circle at 1/2 radius
1103-
currCornerRadius = maxCornerRadius * Math.min(1, (currCornerRadius / radius) * 2);
1104-
const normalVec1 = {x: vec1.x / len1, y: vec1.y / len1};
1105-
const normalVec2 = {x: vec2.x / len2, y: vec2.y / len2};
1103+
currCornerRadius =
1104+
maxCornerRadius * Math.min(1, (currCornerRadius / radius) * 2);
1105+
const normalVec1 = { x: vec1.x / len1, y: vec1.y / len1 };
1106+
const normalVec2 = { x: vec2.x / len2, y: vec2.y / len2 };
11061107
const p1 = {
11071108
x: curr.x - normalVec1.x * currCornerRadius,
11081109
y: curr.y - normalVec1.y * currCornerRadius,
@@ -1118,5 +1119,5 @@ export const Util = {
11181119
}
11191120
context.arcTo(curr.x, curr.y, p2.x, p2.y, currCornerRadius);
11201121
}
1121-
}
1122+
},
11221123
};

src/filters/Emboss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Emboss: Filter = function (imageData) {
3131
w = imageData.width,
3232
h = imageData.height,
3333
w4 = w * 4;
34-
let dirY = 0,
34+
let dirY = 0,
3535
dirX = 0,
3636
y = h;
3737

src/filters/Enhance.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { Factory } from '../Factory';
22
import { Node, Filter } from '../Node';
33
import { getNumberValidator } from '../Validators';
44

5-
function remap(fromValue: number, fromMin: number, fromMax: number, toMin: number, toMax: number) {
5+
function remap(
6+
fromValue: number,
7+
fromMin: number,
8+
fromMax: number,
9+
toMin: number,
10+
toMax: number
11+
) {
612
// Compute the range of the data
713
const fromRange = fromMax - fromMin,
814
toRange = toMax - toMin;

0 commit comments

Comments
 (0)