You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/group.js
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,13 @@ export class Group extends Shape {
197
197
*/
198
198
_mask=null;
199
199
200
+
/**
201
+
* @name Two.Group#_strokeAttenuation
202
+
* @private
203
+
* @see {@link Two.Group#strokeAttenuation}
204
+
*/
205
+
_strokeAttenuation=true;
206
+
200
207
constructor(children){
201
208
super();
202
209
@@ -1084,6 +1091,27 @@ const proto = {
1084
1091
}
1085
1092
},
1086
1093
},
1094
+
1095
+
/**
1096
+
* @name Two.Group#strokeAttenuation
1097
+
* @property {Boolean} - When set to `true`, stroke width scales with transformations (default behavior). When `false`, stroke width remains constant in screen space for all child shapes.
1098
+
* @description When `strokeAttenuation` is `false`, this property is applied to all child shapes, making their stroke widths automatically adjust to compensate for the group's world transform scale, maintaining constant visual thickness regardless of zoom level. When `true` (default), stroke widths scale normally with transformations.
@@ -250,6 +257,13 @@ export class Path extends Shape {
250
257
*/
251
258
_dashes=null;
252
259
260
+
/**
261
+
* @name Two.Path#_strokeAttenuation
262
+
* @private
263
+
* @see {@link Two.Path#strokeAttenuation}
264
+
*/
265
+
_strokeAttenuation=true;
266
+
253
267
constructor(vertices,closed,curved,manual){
254
268
super();
255
269
@@ -407,6 +421,7 @@ export class Path extends Shape {
407
421
'beginning',
408
422
'ending',
409
423
'dashes',
424
+
'strokeAttenuation',
410
425
];
411
426
412
427
staticUtils={
@@ -1231,6 +1246,7 @@ export class Path extends Shape {
1231
1246
this._flagJoin=
1232
1247
this._flagMiter=
1233
1248
this._flagClip=
1249
+
this._flagStrokeAttenuation=
1234
1250
false;
1235
1251
1236
1252
Shape.prototype.flagReset.call(this);
@@ -1516,6 +1532,23 @@ const proto = {
1516
1532
this._dashes=v;
1517
1533
},
1518
1534
},
1535
+
1536
+
/**
1537
+
* @name Two.Path#strokeAttenuation
1538
+
* @property {Boolean} - When set to `true`, stroke width scales with transformations (default behavior). When `false`, stroke width remains constant in screen space.
1539
+
* @description When `strokeAttenuation` is `false`, the stroke width is automatically adjusted to compensate for the object's world transform scale, maintaining constant visual thickness regardless of zoom level. When `true` (default), stroke width scales normally with transformations.
Copy file name to clipboardExpand all lines: src/shapes/points.js
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ export class Points extends Shape {
41
41
_flagVisible=true;
42
42
_flagSize=true;
43
43
_flagSizeAttenuation=true;
44
+
_flagStrokeAttenuation=true;
44
45
45
46
_length=0;
46
47
_fill='#fff';
@@ -53,6 +54,7 @@ export class Points extends Shape {
53
54
_beginning=0;
54
55
_ending=1.0;
55
56
_dashes=null;
57
+
_strokeAttenuation=true;
56
58
57
59
constructor(vertices){
58
60
super();
@@ -180,6 +182,7 @@ export class Points extends Shape {
180
182
'beginning',
181
183
'ending',
182
184
'dashes',
185
+
'strokeAttenuation',
183
186
];
184
187
185
188
/**
@@ -702,4 +705,21 @@ const proto = {
702
705
this._dashes=v;
703
706
},
704
707
},
708
+
709
+
/**
710
+
* @name Two.Points#strokeAttenuation
711
+
* @property {Boolean} - When set to `true`, stroke width scales with transformations (default behavior). When `false`, stroke width remains constant in screen space.
712
+
* @description When `strokeAttenuation` is `false`, the stroke width is automatically adjusted to compensate for the object's world transform scale, maintaining constant visual thickness regardless of zoom level. When `true` (default), stroke width scales normally with transformations.
* @property {Boolean} - When set to `true`, stroke width scales with transformations (default behavior). When `false`, stroke width remains constant in screen space.
868
+
* @description When `strokeAttenuation` is `false`, the stroke width is automatically adjusted to compensate for the object's world transform scale, maintaining constant visual thickness regardless of zoom level. When `true` (default), stroke width scales normally with transformations.
0 commit comments