@inweb/markup 25.8.16 → 25.8.19
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/markup.js +29 -4
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +20 -4
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/IMarkup.d.ts +33 -29
- package/lib/markup/IMarkupLine.d.ts +1 -1
- package/lib/markup/IWorldTransform.d.ts +2 -2
- package/lib/markup/Konva/KonvaImage.d.ts +3 -0
- package/package.json +3 -3
- package/src/markup/IMarkup.ts +33 -29
- package/src/markup/IMarkupLine.ts +1 -1
- package/src/markup/IWorldTransform.ts +2 -2
- package/src/markup/Konva/KonvaImage.ts +33 -4
- package/src/markup/Konva/KonvaMarkup.ts +2 -0
package/lib/markup/IMarkup.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { IViewpoint } from "@inweb/viewer-core";
|
|
|
3
3
|
import { IWorldTransform } from "./IWorldTransform";
|
|
4
4
|
import { IMarkupObject } from "./IMarkupObject";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Defines the markup edit mode. Matches the type of markup object being created.
|
|
7
7
|
*/
|
|
8
8
|
export type MarkupMode = "SelectMarkup" | "Line" | "Text" | "Rectangle" | "Ellipse" | "Arrow" | "Image" | "Cloud";
|
|
9
9
|
/**
|
|
@@ -11,30 +11,35 @@ export type MarkupMode = "SelectMarkup" | "Line" | "Text" | "Rectangle" | "Ellip
|
|
|
11
11
|
*/
|
|
12
12
|
export interface IMarkup {
|
|
13
13
|
/**
|
|
14
|
-
* Line width of
|
|
14
|
+
* Line width of new markup objects.
|
|
15
|
+
*
|
|
16
|
+
* @default 4
|
|
15
17
|
*/
|
|
16
18
|
lineWidth: number;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* Line type of new markup objects. Can be `solid`, `dot` or `dash`.
|
|
21
|
+
*
|
|
22
|
+
* @default `solid`
|
|
19
23
|
*/
|
|
20
24
|
lineType: string;
|
|
21
25
|
/**
|
|
22
|
-
* Font size of
|
|
26
|
+
* Font size of new markup text, in pixels.
|
|
27
|
+
*
|
|
28
|
+
* @default 34
|
|
23
29
|
*/
|
|
24
30
|
fontSize: number;
|
|
25
31
|
/**
|
|
26
|
-
* Initializes the markup instance.
|
|
32
|
+
* Initializes the markup instance. Call {@link dispose | dispose()} to release allocated resources.
|
|
27
33
|
*
|
|
28
|
-
* @param container - Container element used to operate on. This is usually a
|
|
29
|
-
*
|
|
30
|
-
* {@link https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement | HTMLCanvasElement},
|
|
34
|
+
* @param container - Container element used to operate on. This is usually a `<canvas>` or
|
|
35
|
+
* `<div>` on top of which the markup is drawn. If the `container` is a `<canvas>` element,
|
|
31
36
|
* its content will be combined with the markup in the viewpoint snapshot.
|
|
32
37
|
* @param pointerEvents - List of pointing device events that the markup should redirect to
|
|
33
38
|
* the `viewer`.
|
|
34
39
|
* @param viewer - `Viewer` instance that receives pointing device events.
|
|
35
40
|
* @param worldTransformer - Transformer of screen space into the `viewer` world space and
|
|
36
|
-
* vice versa. If a transformer is defined,
|
|
37
|
-
* coordinates, otherwise in screen coordinates.
|
|
41
|
+
* vice versa. If a transformer is defined, markup objects will be stored at the viewpoint
|
|
42
|
+
* in world coordinates, otherwise in screen coordinates.
|
|
38
43
|
*/
|
|
39
44
|
initialize(container: HTMLElement, pointerEvents?: string[], viewer?: IEventEmitter, worldTransformer?: IWorldTransform): void;
|
|
40
45
|
/**
|
|
@@ -42,15 +47,15 @@ export interface IMarkup {
|
|
|
42
47
|
*/
|
|
43
48
|
dispose(): void;
|
|
44
49
|
/**
|
|
45
|
-
*
|
|
50
|
+
* Creates the markup overlay.
|
|
46
51
|
*/
|
|
47
52
|
syncOverlay(): void;
|
|
48
53
|
/**
|
|
49
|
-
*
|
|
54
|
+
* Deletes all markup objects and clears the markup overlay.
|
|
50
55
|
*/
|
|
51
56
|
clearOverlay(): void;
|
|
52
57
|
/**
|
|
53
|
-
*
|
|
58
|
+
* Sets the color of new markup objects.
|
|
54
59
|
*
|
|
55
60
|
* @param r - `Red` part of color.
|
|
56
61
|
* @param g - `Green` part of color.
|
|
@@ -58,9 +63,7 @@ export interface IMarkup {
|
|
|
58
63
|
*/
|
|
59
64
|
setMarkupColor(r: number, g: number, b: number): void;
|
|
60
65
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @returns Color with `RGB` values.
|
|
66
|
+
* Returns the color of new markup objects.
|
|
64
67
|
*/
|
|
65
68
|
getMarkupColor(): {
|
|
66
69
|
r: number;
|
|
@@ -68,7 +71,7 @@ export interface IMarkup {
|
|
|
68
71
|
b: number;
|
|
69
72
|
};
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Colors all markup objects with the specified color.
|
|
72
75
|
*
|
|
73
76
|
* @param r - `Red` part of color.
|
|
74
77
|
* @param g - `Green` part of color.
|
|
@@ -76,7 +79,7 @@ export interface IMarkup {
|
|
|
76
79
|
*/
|
|
77
80
|
colorizeAllMarkup(r: number, g: number, b: number): void;
|
|
78
81
|
/**
|
|
79
|
-
*
|
|
82
|
+
* Colors selected markup objects with the specified color.
|
|
80
83
|
*
|
|
81
84
|
* @param r - `Red` part of color.
|
|
82
85
|
* @param g - `Green` part of color.
|
|
@@ -84,45 +87,46 @@ export interface IMarkup {
|
|
|
84
87
|
*/
|
|
85
88
|
colorizeSelectedMarkups(r: number, g: number, b: number): void;
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
90
|
+
* Sets the markup state to the specified viewpoint.
|
|
88
91
|
*
|
|
89
92
|
* @param viewpoint - Viewpoint data.
|
|
90
93
|
*/
|
|
91
94
|
setViewpoint(viewpoint: IViewpoint): void;
|
|
92
95
|
/**
|
|
93
|
-
*
|
|
96
|
+
* Saves the markup state at the viewpoint.
|
|
94
97
|
*/
|
|
95
98
|
getViewpoint(): IViewpoint;
|
|
96
99
|
/**
|
|
97
100
|
* Enables mouse interactions to select or draw markups.
|
|
98
101
|
*
|
|
99
|
-
* @param mode - Edit mode. Matches the type of markup object being created
|
|
100
|
-
*
|
|
102
|
+
* @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
|
|
103
|
+
* to exit edit mode.
|
|
101
104
|
*/
|
|
102
105
|
enableEditMode(mode: MarkupMode | false): this;
|
|
103
106
|
/**
|
|
104
|
-
*
|
|
107
|
+
* Creates a markup object.
|
|
105
108
|
*
|
|
106
|
-
* @param type -
|
|
109
|
+
* @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
|
|
110
|
+
* `Image` or `Cloud`.
|
|
107
111
|
* @param params - Markup object parameters.
|
|
108
112
|
*/
|
|
109
113
|
createObject(type: string, params: any): IMarkupObject;
|
|
110
114
|
/**
|
|
111
|
-
*
|
|
115
|
+
* Returns the list of all markup objects.
|
|
112
116
|
*/
|
|
113
117
|
getObjects(): IMarkupObject[];
|
|
114
118
|
/**
|
|
115
|
-
*
|
|
119
|
+
* Returns the list of selected markup objects.
|
|
116
120
|
*/
|
|
117
121
|
getSelectedObjects(): IMarkupObject[];
|
|
118
122
|
/**
|
|
119
|
-
*
|
|
123
|
+
* Selects specified markup objects.
|
|
120
124
|
*
|
|
121
|
-
* @param objects
|
|
125
|
+
* @param objects - The list of markup objects.
|
|
122
126
|
*/
|
|
123
127
|
selectObjects(objects: IMarkupObject[]): void;
|
|
124
128
|
/**
|
|
125
|
-
*
|
|
129
|
+
* Clears the markup objects selection.
|
|
126
130
|
*/
|
|
127
131
|
clearSelected(): void;
|
|
128
132
|
}
|
|
@@ -5,7 +5,7 @@ export interface IWorldTransform {
|
|
|
5
5
|
/**
|
|
6
6
|
* Transforms `position` from screen space into world space.
|
|
7
7
|
*
|
|
8
|
-
* @param position -
|
|
8
|
+
* @param position - Screen position in pixels.
|
|
9
9
|
*/
|
|
10
10
|
screenToWorld(position: {
|
|
11
11
|
x: number;
|
|
@@ -18,7 +18,7 @@ export interface IWorldTransform {
|
|
|
18
18
|
/**
|
|
19
19
|
* Transforms `position` from world space into screen space.
|
|
20
20
|
*
|
|
21
|
-
* @param position -
|
|
21
|
+
* @param position - Position in world space coordinates.
|
|
22
22
|
*/
|
|
23
23
|
worldToScreen(position: {
|
|
24
24
|
x: number;
|
|
@@ -3,6 +3,7 @@ export declare class KonvaImage implements IMarkupImage {
|
|
|
3
3
|
private _ref;
|
|
4
4
|
private _canvasImage;
|
|
5
5
|
private _ratio;
|
|
6
|
+
private readonly EPSILON;
|
|
6
7
|
constructor(params: {
|
|
7
8
|
position: {
|
|
8
9
|
x: number;
|
|
@@ -11,6 +12,8 @@ export declare class KonvaImage implements IMarkupImage {
|
|
|
11
12
|
src: string;
|
|
12
13
|
width?: number;
|
|
13
14
|
height?: number;
|
|
15
|
+
maxWidth?: number;
|
|
16
|
+
maxHeight?: number;
|
|
14
17
|
id?: string;
|
|
15
18
|
}, ref?: any);
|
|
16
19
|
getSrc(): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/markup",
|
|
3
|
-
"version": "25.8.
|
|
3
|
+
"version": "25.8.19",
|
|
4
4
|
"description": "JavaScript 2D markups",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~25.8.
|
|
30
|
-
"@inweb/viewer-core": "~25.8.
|
|
29
|
+
"@inweb/eventemitter2": "~25.8.19",
|
|
30
|
+
"@inweb/viewer-core": "~25.8.19"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"konva": "^9.2.0"
|
package/src/markup/IMarkup.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { IWorldTransform } from "./IWorldTransform";
|
|
|
27
27
|
import { IMarkupObject } from "./IMarkupObject";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Defines the markup edit mode. Matches the type of markup object being created.
|
|
31
31
|
*/
|
|
32
32
|
export type MarkupMode = "SelectMarkup" | "Line" | "Text" | "Rectangle" | "Ellipse" | "Arrow" | "Image" | "Cloud";
|
|
33
33
|
|
|
@@ -36,33 +36,38 @@ export type MarkupMode = "SelectMarkup" | "Line" | "Text" | "Rectangle" | "Ellip
|
|
|
36
36
|
*/
|
|
37
37
|
export interface IMarkup {
|
|
38
38
|
/**
|
|
39
|
-
* Line width of
|
|
39
|
+
* Line width of new markup objects.
|
|
40
|
+
*
|
|
41
|
+
* @default 4
|
|
40
42
|
*/
|
|
41
43
|
lineWidth: number;
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* Line type of new markup objects. Can be `solid`, `dot` or `dash`.
|
|
47
|
+
*
|
|
48
|
+
* @default `solid`
|
|
45
49
|
*/
|
|
46
50
|
lineType: string;
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
|
-
* Font size of
|
|
53
|
+
* Font size of new markup text, in pixels.
|
|
54
|
+
*
|
|
55
|
+
* @default 34
|
|
50
56
|
*/
|
|
51
57
|
fontSize: number;
|
|
52
58
|
|
|
53
59
|
/**
|
|
54
|
-
* Initializes the markup instance.
|
|
60
|
+
* Initializes the markup instance. Call {@link dispose | dispose()} to release allocated resources.
|
|
55
61
|
*
|
|
56
|
-
* @param container - Container element used to operate on. This is usually a
|
|
57
|
-
*
|
|
58
|
-
* {@link https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement | HTMLCanvasElement},
|
|
62
|
+
* @param container - Container element used to operate on. This is usually a `<canvas>` or
|
|
63
|
+
* `<div>` on top of which the markup is drawn. If the `container` is a `<canvas>` element,
|
|
59
64
|
* its content will be combined with the markup in the viewpoint snapshot.
|
|
60
65
|
* @param pointerEvents - List of pointing device events that the markup should redirect to
|
|
61
66
|
* the `viewer`.
|
|
62
67
|
* @param viewer - `Viewer` instance that receives pointing device events.
|
|
63
68
|
* @param worldTransformer - Transformer of screen space into the `viewer` world space and
|
|
64
|
-
* vice versa. If a transformer is defined,
|
|
65
|
-
* coordinates, otherwise in screen coordinates.
|
|
69
|
+
* vice versa. If a transformer is defined, markup objects will be stored at the viewpoint
|
|
70
|
+
* in world coordinates, otherwise in screen coordinates.
|
|
66
71
|
*/
|
|
67
72
|
initialize(
|
|
68
73
|
container: HTMLElement,
|
|
@@ -77,17 +82,17 @@ export interface IMarkup {
|
|
|
77
82
|
dispose(): void;
|
|
78
83
|
|
|
79
84
|
/**
|
|
80
|
-
*
|
|
85
|
+
* Creates the markup overlay.
|
|
81
86
|
*/
|
|
82
87
|
syncOverlay(): void;
|
|
83
88
|
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
90
|
+
* Deletes all markup objects and clears the markup overlay.
|
|
86
91
|
*/
|
|
87
92
|
clearOverlay(): void;
|
|
88
93
|
|
|
89
94
|
/**
|
|
90
|
-
*
|
|
95
|
+
* Sets the color of new markup objects.
|
|
91
96
|
*
|
|
92
97
|
* @param r - `Red` part of color.
|
|
93
98
|
* @param g - `Green` part of color.
|
|
@@ -96,14 +101,12 @@ export interface IMarkup {
|
|
|
96
101
|
setMarkupColor(r: number, g: number, b: number): void;
|
|
97
102
|
|
|
98
103
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @returns Color with `RGB` values.
|
|
104
|
+
* Returns the color of new markup objects.
|
|
102
105
|
*/
|
|
103
106
|
getMarkupColor(): { r: number; g: number; b: number };
|
|
104
107
|
|
|
105
108
|
/**
|
|
106
|
-
*
|
|
109
|
+
* Colors all markup objects with the specified color.
|
|
107
110
|
*
|
|
108
111
|
* @param r - `Red` part of color.
|
|
109
112
|
* @param g - `Green` part of color.
|
|
@@ -112,7 +115,7 @@ export interface IMarkup {
|
|
|
112
115
|
colorizeAllMarkup(r: number, g: number, b: number): void;
|
|
113
116
|
|
|
114
117
|
/**
|
|
115
|
-
*
|
|
118
|
+
* Colors selected markup objects with the specified color.
|
|
116
119
|
*
|
|
117
120
|
* @param r - `Red` part of color.
|
|
118
121
|
* @param g - `Green` part of color.
|
|
@@ -121,52 +124,53 @@ export interface IMarkup {
|
|
|
121
124
|
colorizeSelectedMarkups(r: number, g: number, b: number): void;
|
|
122
125
|
|
|
123
126
|
/**
|
|
124
|
-
*
|
|
127
|
+
* Sets the markup state to the specified viewpoint.
|
|
125
128
|
*
|
|
126
129
|
* @param viewpoint - Viewpoint data.
|
|
127
130
|
*/
|
|
128
131
|
setViewpoint(viewpoint: IViewpoint): void;
|
|
129
132
|
|
|
130
133
|
/**
|
|
131
|
-
*
|
|
134
|
+
* Saves the markup state at the viewpoint.
|
|
132
135
|
*/
|
|
133
136
|
getViewpoint(): IViewpoint;
|
|
134
137
|
|
|
135
138
|
/**
|
|
136
139
|
* Enables mouse interactions to select or draw markups.
|
|
137
140
|
*
|
|
138
|
-
* @param mode - Edit mode. Matches the type of markup object being created
|
|
139
|
-
*
|
|
141
|
+
* @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
|
|
142
|
+
* to exit edit mode.
|
|
140
143
|
*/
|
|
141
144
|
enableEditMode(mode: MarkupMode | false): this;
|
|
142
145
|
|
|
143
146
|
/**
|
|
144
|
-
*
|
|
147
|
+
* Creates a markup object.
|
|
145
148
|
*
|
|
146
|
-
* @param type -
|
|
149
|
+
* @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
|
|
150
|
+
* `Image` or `Cloud`.
|
|
147
151
|
* @param params - Markup object parameters.
|
|
148
152
|
*/
|
|
149
153
|
createObject(type: string, params: any): IMarkupObject;
|
|
150
154
|
|
|
151
155
|
/**
|
|
152
|
-
*
|
|
156
|
+
* Returns the list of all markup objects.
|
|
153
157
|
*/
|
|
154
158
|
getObjects(): IMarkupObject[];
|
|
155
159
|
|
|
156
160
|
/**
|
|
157
|
-
*
|
|
161
|
+
* Returns the list of selected markup objects.
|
|
158
162
|
*/
|
|
159
163
|
getSelectedObjects(): IMarkupObject[];
|
|
160
164
|
|
|
161
165
|
/**
|
|
162
|
-
*
|
|
166
|
+
* Selects specified markup objects.
|
|
163
167
|
*
|
|
164
|
-
* @param objects
|
|
168
|
+
* @param objects - The list of markup objects.
|
|
165
169
|
*/
|
|
166
170
|
selectObjects(objects: IMarkupObject[]): void;
|
|
167
171
|
|
|
168
172
|
/**
|
|
169
|
-
*
|
|
173
|
+
* Clears the markup objects selection.
|
|
170
174
|
*/
|
|
171
175
|
clearSelected(): void;
|
|
172
176
|
}
|
|
@@ -28,14 +28,14 @@ export interface IWorldTransform {
|
|
|
28
28
|
/**
|
|
29
29
|
* Transforms `position` from screen space into world space.
|
|
30
30
|
*
|
|
31
|
-
* @param position -
|
|
31
|
+
* @param position - Screen position in pixels.
|
|
32
32
|
*/
|
|
33
33
|
screenToWorld(position: { x: number; y: number }): { x: number; y: number; z: number };
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Transforms `position` from world space into screen space.
|
|
37
37
|
*
|
|
38
|
-
* @param position -
|
|
38
|
+
* @param position - Position in world space coordinates.
|
|
39
39
|
*/
|
|
40
40
|
worldToScreen(position: { x: number; y: number; z: number }): { x: number; y: number };
|
|
41
41
|
|
|
@@ -5,6 +5,7 @@ export class KonvaImage implements IMarkupImage {
|
|
|
5
5
|
private _ref: Konva.Image;
|
|
6
6
|
private _canvasImage: HTMLImageElement;
|
|
7
7
|
private _ratio = 1;
|
|
8
|
+
private readonly EPSILON = 10e-6;
|
|
8
9
|
|
|
9
10
|
constructor(
|
|
10
11
|
params: {
|
|
@@ -12,6 +13,8 @@ export class KonvaImage implements IMarkupImage {
|
|
|
12
13
|
src: string;
|
|
13
14
|
width?: number;
|
|
14
15
|
height?: number;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
maxHeight?: number;
|
|
15
18
|
id?: string;
|
|
16
19
|
},
|
|
17
20
|
ref = null
|
|
@@ -21,7 +24,10 @@ export class KonvaImage implements IMarkupImage {
|
|
|
21
24
|
|
|
22
25
|
this._ref = ref;
|
|
23
26
|
this._canvasImage = ref.image();
|
|
24
|
-
this._ratio =
|
|
27
|
+
this._ratio =
|
|
28
|
+
this._ref.height() <= this.EPSILON || this._ref.width() <= this.EPSILON
|
|
29
|
+
? 1
|
|
30
|
+
: this._ref.height() / this._ref.width();
|
|
25
31
|
return;
|
|
26
32
|
}
|
|
27
33
|
|
|
@@ -40,9 +46,32 @@ export class KonvaImage implements IMarkupImage {
|
|
|
40
46
|
|
|
41
47
|
this._canvasImage.onload = () => {
|
|
42
48
|
this._ref.image(this._canvasImage);
|
|
43
|
-
if (this._ref.height()
|
|
44
|
-
if (this._ref.width()
|
|
45
|
-
|
|
49
|
+
if (this._ref.height() <= this.EPSILON) this._ref.height(this._canvasImage.height);
|
|
50
|
+
if (this._ref.width() <= this.EPSILON) this._ref.width(this._canvasImage.width);
|
|
51
|
+
|
|
52
|
+
this._ratio =
|
|
53
|
+
this._ref.height() <= this.EPSILON || this._ref.width() <= this.EPSILON
|
|
54
|
+
? 1
|
|
55
|
+
: this._ref.height() / this._ref.width();
|
|
56
|
+
|
|
57
|
+
// need to rescale only if input width and height are 0 - we do not loading Viewpoint with existing params
|
|
58
|
+
if (
|
|
59
|
+
(params.width <= this.EPSILON || params.height <= this.EPSILON) &&
|
|
60
|
+
(params.maxWidth >= this.EPSILON || params.maxWidth >= this.EPSILON)
|
|
61
|
+
) {
|
|
62
|
+
const heightOutOfCanvas = params.maxHeight - this._canvasImage.height;
|
|
63
|
+
const widthOutOfCanvas = params.maxWidth - this._canvasImage.width;
|
|
64
|
+
|
|
65
|
+
if (heightOutOfCanvas <= this.EPSILON || widthOutOfCanvas <= this.EPSILON) {
|
|
66
|
+
if (widthOutOfCanvas <= this.EPSILON && widthOutOfCanvas < heightOutOfCanvas / this._ratio) {
|
|
67
|
+
this._ref.height(params.maxWidth * this._ratio);
|
|
68
|
+
this._ref.width(params.maxWidth);
|
|
69
|
+
} else {
|
|
70
|
+
this._ref.width(params.maxHeight / this._ratio);
|
|
71
|
+
this._ref.height(params.maxHeight);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
46
75
|
};
|
|
47
76
|
|
|
48
77
|
this._canvasImage.src = params.src;
|