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/easeljs/display/DisplayObject.js
+46-48Lines changed: 46 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ var p = DisplayObject.prototype;
169
169
/**
170
170
* Dispatched when the user double clicks their left mouse button over this display object.
171
171
* See the {{#crossLink "MouseEvent"}}{{/crossLink}} class for a listing of event properties.
172
-
* @eventdblClick
172
+
* @eventdblclick
173
173
* @since 0.6.0
174
174
*/
175
175
@@ -191,15 +191,15 @@ var p = DisplayObject.prototype;
191
191
*/
192
192
193
193
/**
194
-
* Dispatched on each display object on a stage whenever the stage updates.
195
-
* This occurs immediately before the rendering (draw) pass. When {{#crossLink "Stage/update"}}{{/crossLink}} is called, first all display objects
196
-
* on the stage dispatch the tick event, then all of the display objects are drawn to stage. Children will have their
194
+
* Dispatched on each display object on a stage whenever the stage updates. This occurs immediately before the
195
+
* rendering (draw) pass. When {{#crossLink "Stage/update"}}{{/crossLink}} is called, first all display objects on
196
+
* the stage dispatch the tick event, then all of the display objects are drawn to stage. Children will have their
197
197
* tick event dispatched in order of their depth prior to the event being dispatched on their parent.
198
198
* @event tick
199
199
* @param {Object} target The object that dispatched the event.
200
200
* @param {String} type The event type.
201
-
* @param {Array} params An array containing any arguments that were passed to the Stage.update() method.
202
-
* For example if you called stage.update("hello"), then the params would be ["hello"].
201
+
* @param {Array} params An array containing any arguments that were passed to the Stage.update() method. For
202
+
* example if you called stage.update("hello"), then the params would be ["hello"].
203
203
* @since 0.6.0
204
204
*/
205
205
@@ -230,10 +230,10 @@ var p = DisplayObject.prototype;
230
230
p.id=-1;
231
231
232
232
/**
233
-
* Indicates whether to include this object when running Stage.getObjectsUnderPoint(), and thus for mouse
234
-
* interactions. Setting this to true for
235
-
* Containers will cause the Container to be returned (not its children) regardless of whether it's mouseChildren property
236
-
* is true.
233
+
* Indicates whether to include this object when running mouse interactions. Setting this to `false` for children
234
+
* of a {{#crossLink "Container"}}{{/crossLink}} will cause events on the Container to not fire when that child is
235
+
* clicked. Note that setting this property to `false` does not prevent the {{#crossLink "Container/getObjectsUnderPoint"}}{{/crossLink}}
236
+
* method from returning the child.
237
237
* @property mouseEnabled
238
238
* @type {Boolean}
239
239
* @default true
@@ -249,8 +249,8 @@ var p = DisplayObject.prototype;
249
249
p.name=null;
250
250
251
251
/**
252
-
* A reference to the Container or Stage object that contains this display object, or null if it has not been added to
253
-
* one. READ-ONLY.
252
+
* A reference to the Container or Stage object that contains this display object, or null if it has not been added
253
+
* to one. READ-ONLY.
254
254
* @property parent
255
255
* @final
256
256
* @type {Container}
@@ -429,34 +429,33 @@ var p = DisplayObject.prototype;
429
429
430
430
/**
431
431
* The onTick callback is called on each display object on a stage whenever the stage updates.
432
-
* This occurs immediately before the rendering (draw) pass. When stage.update() is called, first all display objects
433
-
* on the stage have onTick called, then all of the display objects are drawn to stage. Children will have their
434
-
* onTick called in order of their depth prior to onTick being called on their parent.
435
-
* <br/><br/>
436
-
* Any parameters passed in to stage.update() are passed on to the onTick() handlers. For example, if you call
437
-
* stage.update("hello"), all of the display objects with a handler will have onTick("hello") called.
432
+
* This occurs immediately before the rendering (draw) pass. When stage.update() is called, first all display
433
+
* objects on the stage have onTick called, then all of the display objects are drawn to stage. Children will have
434
+
* their `onTick` called in order of their depth prior to onTick being called on their parent.
435
+
*
436
+
* Any parameters passed in to `stage.update()` are passed on to the `onTick()` handlers. For example, if you call
437
+
* `stage.update("hello")`, all of the display objects with a handler will have `onTick("hello")` called.
438
438
* @property onTick
439
439
* @type {Function}
440
440
* @deprecated In favour of the "tick" event. Will be removed in a future version.
441
441
*/
442
442
p.onTick=null;
443
443
444
444
/**
445
-
* An array of Filter objects to apply to this display object. Filters are only applied / updated when cache() or
446
-
* updateCache() is called on the display object, and only apply to the area that is cached.
445
+
* An array of Filter objects to apply to this display object. Filters are only applied / updated when `cache()` or
446
+
* `updateCache()` is called on the display object, and only apply to the area that is cached.
447
447
* @property filters
448
448
* @type {Array}
449
449
* @default null
450
450
**/
451
451
p.filters=null;
452
452
453
453
/**
454
-
* Returns an ID number that uniquely identifies the current cache for this display object.
455
-
* This can be used to determine if the cache has changed since a previous check.
456
-
* @property cacheID
457
-
* @type {Number}
458
-
* @default 0
459
-
*/
454
+
* Returns an ID number that uniquely identifies the current cache for this display object. This can be used to * determine if the cache has changed since a previous check.
455
+
* @property cacheID
456
+
* @type {Number}
457
+
* @default 0
458
+
*/
460
459
p.cacheID=0;
461
460
462
461
/**
@@ -469,21 +468,23 @@ var p = DisplayObject.prototype;
469
468
p.mask=null;
470
469
471
470
/**
472
-
* A display object that will be tested when checking mouse interactions or testing getObjectsUnderPoint. The hit area
473
-
* will have its transformation applied relative to this display object's coordinate space (as though the hit test object were a child of this
474
-
* display object and relative to its regX/Y). The hitArea will be tested using only its own alpha value regardless of the alpha value on
475
-
* the target display object, or the target's ancestors (parents). hitArea is NOT currently used by the hitTest() method.
476
-
*
477
-
* Note that hitArea is not supported for Stage.
471
+
* A display object that will be tested when checking mouse interactions or testing {{#crossLink "Container/getObjectsUnderPoint"}}{{/crossLink}}.
472
+
* The hit area will have its transformation applied relative to this display object's coordinate space (as though
473
+
* the hit test object were a child of this display object and relative to its regX/Y). The hitArea will be tested
474
+
* using only its own `alpha` value regardless of the alpha value on the target display object, or the target's
475
+
* ancestors (parents).
476
+
*
477
+
* Note that hitArea is NOT currently used by the `hitTest()` method, nor is it supported for {{#crossLink "Stage"}}{{/crossLink}}.
478
478
* @property hitArea
479
479
* @type {DisplayObject}
480
480
* @default null
481
481
*/
482
482
p.hitArea=null;
483
483
484
484
/**
485
-
* A CSS cursor (ex. "pointer", "help", "text", etc) that will be displayed when the user hovers over this display object. You must enable
486
-
* mouseover events using the stage.enableMouseOver() method to use this property. If null it will use the default cursor.
485
+
* A CSS cursor (ex. "pointer", "help", "text", etc) that will be displayed when the user hovers over this display
486
+
* object. You must enable mouseover events using the {{#crossLink "Stage/enableMouseOver"}}{{/crossLink}} method to
487
+
* use this property. If null it will use the default cursor.
487
488
* @property cursor
488
489
* @type {String}
489
490
* @default null
@@ -580,13 +581,13 @@ var p = DisplayObject.prototype;
580
581
581
582
/**
582
583
* Draws the display object into the specified context ignoring it's visible, alpha, shadow, and transform.
583
-
* Returns true if the draw was handled (useful for overriding functionality).
584
+
* Returns `true` if the draw was handled (useful for overriding functionality).
585
+
*
584
586
* NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
585
587
* @method draw
586
588
* @param {CanvasRenderingContext2D} ctx The canvas 2D context object to draw into.
587
-
* @param {Boolean} ignoreCache Indicates whether the draw operation should ignore any current cache.
588
-
* For example, used for drawing the cache (to prevent it from simply drawing an existing cache back
589
-
* into itself).
589
+
* @param {Boolean} ignoreCache Indicates whether the draw operation should ignore any current cache. For example,
590
+
* used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).
590
591
**/
591
592
p.draw=function(ctx,ignoreCache){
592
593
varcacheCanvas=this.cacheCanvas;
@@ -597,9 +598,9 @@ var p = DisplayObject.prototype;
597
598
}
598
599
599
600
/**
600
-
* Applies this display object's transformation, alpha, globalCompositeOperation, clipping path (mask), and shadow to the specified
601
-
* context. This is typically called prior to draw.
602
-
* @methodsetupContext
601
+
* Applies this display object's transformation, alpha, globalCompositeOperation, clipping path (mask), and shadow
602
+
* to the specified context. This is typically called prior to {{#crossLink "DisplayObject/draw"}}{{/crossLink}}.
603
+
* @methodupdateContext
603
604
* @param {CanvasRenderingContext2D} ctx The canvas 2D to update.
604
605
**/
605
606
p.updateContext=function(ctx){
@@ -639,7 +640,7 @@ var p = DisplayObject.prototype;
639
640
* @param {Number} y The y coordinate origin for the cache region.
640
641
* @param {Number} width The width of the cache region.
641
642
* @param {Number} height The height of the cache region.
642
-
* @param {Number} scale Optional. The scale at which the cache will be created. For example, if you cache a vector shape using
643
+
* @param {Number} [scale=1] The scale at which the cache will be created. For example, if you cache a vector shape using
643
644
* myShape.cache(0,0,100,100,2) then the resulting cacheCanvas will be 200x200 px. This lets you scale and rotate
644
645
* cached elements with greater fidelity. Default is 1.
645
646
**/
@@ -843,15 +844,12 @@ var p = DisplayObject.prototype;
Copy file name to clipboardExpand all lines: src/easeljs/display/Graphics.js
+21-15Lines changed: 21 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -941,31 +941,37 @@ var p = Graphics.prototype;
941
941
}
942
942
returnthis;
943
943
};
944
-
944
+
945
945
/**
946
946
* Decodes a compact encoded path string into a series of draw instructions.
947
947
* This format is not intended to be human readable, and is meant for use by authoring tools.
948
-
* The format uses a base64 character set, with each character representing 6 bits, to define a series of draw commands.
948
+
* The format uses a base64 character set, with each character representing 6 bits, to define a series of draw
949
+
* commands.
949
950
*
950
-
* Each command is comprised of a single "header" character followed by a variable number of alternating x and y position values.
951
-
* Reading the header bits from left to right (most to least significant): bits 1 to 3 specify the type of operation
952
-
* (0-moveTo, 1-lineTo, 2-quadraticCurveTo, 3-bezierCurveTo, 4-closePath, 5-7 unused). Bit 4 indicates whether position values use 12 bits (2 characters)
953
-
* or 18 bits (3 characters), with a one indicating the latter. Bits 5 and 6 are currently unused.
951
+
* Each command is comprised of a single "header" character followed by a variable number of alternating x and y
952
+
* position values. Reading the header bits from left to right (most to least significant): bits 1 to 3 specify the
953
+
* type of operation (0-moveTo, 1-lineTo, 2-quadraticCurveTo, 3-bezierCurveTo, 4-closePath, 5-7 unused). Bit 4
954
+
* indicates whether position values use 12 bits (2 characters) or 18 bits (3 characters), with a one indicating the
955
+
* latter. Bits 5 and 6 are currently unused.
954
956
*
955
-
* Following the header is a series of 0 (closePath), 2 (moveTo, lineTo), 4 (quadraticCurveTo), or 6 (bezierCurveTo) parameters.
956
-
* These parameters are alternating x/y positions represented by 2 or 3 characters (as indicated by the 4th bit in the command char).
957
-
* These characters consist of a 1 bit sign (1 is negative, 0 is positive), followed by an 11 (2 char) or 17 (3 char) bit integer value.
958
-
* All position values are in tenths of a pixel.
959
-
* Except in the case of move operations which are absolute, this value is a delta from the previous x or y position (as appropriate).
957
+
* Following the header is a series of 0 (closePath), 2 (moveTo, lineTo), 4 (quadraticCurveTo), or 6 (bezierCurveTo)
958
+
* parameters. These parameters are alternating x/y positions represented by 2 or 3 characters (as indicated by the
959
+
* 4th bit in the command char). These characters consist of a 1 bit sign (1 is negative, 0 is positive), followed
960
+
* by an 11 (2 char) or 17 (3 char) bit integer value. All position values are in tenths of a pixel. Except in the
961
+
* case of move operations which are absolute, this value is a delta from the previous x or y position (as
962
+
* appropriate).
960
963
*
961
964
* For example, the string "A3cAAMAu4AAA" represents a line starting at -150,0 and ending at 150,0.
962
-
* <br />A - bits 000000. First 3 bits (000) indicate a moveTo operation. 4th bit (0) indicates 2 chars per parameter.
963
-
* <br />n0 - 110111011100. Absolute x position of -150.0px. First bit indicates a negative value, remaining bits indicate 1500 tenths of a pixel.
965
+
* <br />A - bits 000000. First 3 bits (000) indicate a moveTo operation. 4th bit (0) indicates 2 chars per
966
+
* parameter.
967
+
* <br />n0 - 110111011100. Absolute x position of -150.0px. First bit indicates a negative value, remaining bits
968
+
* indicate 1500 tenths of a pixel.
964
969
* <br />AA - 000000000000. Absolute y position of 0.
965
970
* <br />I - 001100. First 3 bits (001) indicate a lineTo operation. 4th bit (1) indicates 3 chars per parameter.
966
-
* <br />Au4 - 000000101110111000. An x delta of 300.0px, which is added to the previous x value of -150.0px to provide an absolute position of +150.0px.
971
+
* <br />Au4 - 000000101110111000. An x delta of 300.0px, which is added to the previous x value of -150.0px to
972
+
* provide an absolute position of +150.0px.
967
973
* <br />AAA - 000000000000000000. A y delta value of 0.
968
-
*
974
+
*
969
975
* @method decodePath
970
976
* @param {String} str The path string to decode.
971
977
* @return {Graphics} The Graphics instance the method is called on (useful for chaining calls.)
0 commit comments