From bed414305975613f4244d2ca6bbe05cfd91eb6c1 Mon Sep 17 00:00:00 2001 From: Steve Eberhardt <9057412+melchiar@users.noreply.github.com> Date: Mon, 11 Mar 2019 03:38:37 -0700 Subject: [PATCH] Spelling & grammar fixes within mixins (#5568) * Various corrections to spelling/grammar * added new shadowUniform property to shadow class for non-scaling shadows * various spelling/grammar corrections * revert shadow changes to master --- src/mixins/canvas_dataurl_exporter.mixin.js | 2 +- src/mixins/canvas_events.mixin.js | 14 ++++----- src/mixins/itext_behavior.mixin.js | 26 ++++++++--------- src/mixins/object_geometry.mixin.js | 32 ++++++++++----------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/mixins/canvas_dataurl_exporter.mixin.js b/src/mixins/canvas_dataurl_exporter.mixin.js index 804357f2608..7e8ee51567b 100644 --- a/src/mixins/canvas_dataurl_exporter.mixin.js +++ b/src/mixins/canvas_dataurl_exporter.mixin.js @@ -47,7 +47,7 @@ * Create a new HTMLCanvas element painted with the current canvas content. * No need to resize the actual one or repaint it. * Will transfer object ownership to a new canvas, paint it, and set everything back. - * This is an intermediary step used to get to a dataUrl but also it is usefull to + * This is an intermediary step used to get to a dataUrl but also it is useful to * create quick image copies of a canvas without passing for the dataUrl string * @param {Number} [multiplier] a zoom factor. * @param {Object} [cropping] Cropping informations diff --git a/src/mixins/canvas_events.mixin.js b/src/mixins/canvas_events.mixin.js index 2420b6691fd..1976f4fc362 100644 --- a/src/mixins/canvas_events.mixin.js +++ b/src/mixins/canvas_events.mixin.js @@ -665,7 +665,7 @@ /** * Method that defines the actions when mouse is hovering the canvas. - * The currentTransform parameter will definde whether the user is rotating/scaling/translating + * The currentTransform parameter will define whether the user is rotating/scaling/translating * an image or neither of them (only hovering). A group selection is also possible and would cancel * all any other type of action. * In case of an image transformation only the top canvas will be rendered. @@ -715,7 +715,7 @@ * @private */ _fireOverOutEvents: function(target, e) { - this.fireSynteticInOutEvents(target, e, { + this.fireSyntheticInOutEvents(target, e, { targetName: '_hoveredTarget', canvasEvtOut: 'mouse:out', evtOut: 'mouseout', @@ -731,7 +731,7 @@ * @private */ _fireEnterLeaveEvents: function(target, e) { - this.fireSynteticInOutEvents(target, e, { + this.fireSyntheticInOutEvents(target, e, { targetName: '_draggedoverTarget', evtOut: 'dragleave', evtIn: 'dragenter', @@ -739,7 +739,7 @@ }, /** - * Manage the syntetic in/out events for the fabric objects on the canvas + * Manage the synthetic in/out events for the fabric objects on the canvas * @param {Fabric.Object} target the target where the target from the supported events * @param {Event} e Event object fired * @param {Object} config configuration for the function to work @@ -750,7 +750,7 @@ * @param {String} config.evtIn name of the event to fire for in * @private */ - fireSynteticInOutEvents: function(target, e, config) { + fireSyntheticInOutEvents: function(target, e, config) { var inOpt, outOpt, oldTarget = this[config.targetName], outFires, inFires, targetChanged = oldTarget !== target, canvasEvtIn = config.canvasEvtIn, canvasEvtOut = config.canvasEvtOut; if (targetChanged) { @@ -871,9 +871,9 @@ /** * @private * @param {Event} e Event object - * @param {Object} transform current tranform + * @param {Object} transform current transform * @param {Number} x mouse position x from origin - * @param {Number} y mouse poistion y from origin + * @param {Number} y mouse position y from origin * @return {Boolean} true if the scaling occurred */ _onScale: function(e, transform, x, y) { diff --git a/src/mixins/itext_behavior.mixin.js b/src/mixins/itext_behavior.mixin.js index 2a52380f94e..2822ea8a97c 100644 --- a/src/mixins/itext_behavior.mixin.js +++ b/src/mixins/itext_behavior.mixin.js @@ -190,7 +190,7 @@ /** * Find new selection index representing start of current word according to current selection index - * @param {Number} startFrom Surrent selection index + * @param {Number} startFrom Current selection index * @return {Number} New selection index */ findWordBoundaryLeft: function(startFrom) { @@ -511,9 +511,9 @@ if (!this.canvas) { return { x: 1, y: 1 }; } - var desiredPostion = this.inCompositionMode ? this.compositionStart : this.selectionStart, - boundaries = this._getCursorBoundaries(desiredPostion), - cursorLocation = this.get2DCursorLocation(desiredPostion), + var desiredPosition = this.inCompositionMode ? this.compositionStart : this.selectionStart, + boundaries = this._getCursorBoundaries(desiredPosition), + cursorLocation = this.get2DCursorLocation(desiredPosition), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex, charHeight = this.getValueOfPropertyAt(lineIndex, charIndex, 'fontSize') * this.lineHeight, @@ -778,7 +778,7 @@ * @param {Number} lineIndex Index of a line * @param {Number} charIndex Index of a char * @param {Number} quantity number Style object to insert, if given - * @param {Array} copiedStyle array of style objecs + * @param {Array} copiedStyle array of style objects */ insertCharStyleObject: function(lineIndex, charIndex, quantity, copiedStyle) { if (!this.styles) { @@ -830,23 +830,23 @@ */ insertNewStyleBlock: function(insertedText, start, copiedStyle) { var cursorLoc = this.get2DCursorLocation(start, true), - addedLines = [0], linesLenght = 0; + addedLines = [0], linesLength = 0; for (var i = 0; i < insertedText.length; i++) { if (insertedText[i] === '\n') { - linesLenght++; - addedLines[linesLenght] = 0; + linesLength++; + addedLines[linesLength] = 0; } else { - addedLines[linesLenght]++; + addedLines[linesLength]++; } } if (addedLines[0] > 0) { this.insertCharStyleObject(cursorLoc.lineIndex, cursorLoc.charIndex, addedLines[0], copiedStyle); copiedStyle = copiedStyle && copiedStyle.slice(addedLines[0] + 1); } - linesLenght && this.insertNewlineStyleObject( - cursorLoc.lineIndex, cursorLoc.charIndex + addedLines[0], linesLenght); - for (var i = 1; i < linesLenght; i++) { + linesLength && this.insertNewlineStyleObject( + cursorLoc.lineIndex, cursorLoc.charIndex + addedLines[0], linesLength); + for (var i = 1; i < linesLength; i++) { if (addedLines[i] > 0) { this.insertCharStyleObject(cursorLoc.lineIndex + i, 0, addedLines[i], copiedStyle); } @@ -862,7 +862,7 @@ }, /** - * Set the selectionStart and selectionEnd according to the ne postion of cursor + * Set the selectionStart and selectionEnd according to the new position of cursor * mimic the key - mouse navigation when shift is pressed. */ setSelectionStartEndWithShift: function(start, end, newSelection) { diff --git a/src/mixins/object_geometry.mixin.js b/src/mixins/object_geometry.mixin.js index 408b8a85099..8a3433bf39f 100644 --- a/src/mixins/object_geometry.mixin.js +++ b/src/mixins/object_geometry.mixin.js @@ -35,7 +35,7 @@ * each property is an object with x, y, instance of Fabric.Point. * The coordinates depends from this properties: width, height, scaleX, scaleY * skewX, skewY, angle, strokeWidth, top, left. - * Those coordinates are usefull to understand where an object is. They get updated + * Those coordinates are useful to understand where an object is. They get updated * with oCoords but they do not need to be updated when zoom or panning change. * The coordinates get updated with @method setCoords. * You can calculate them without updating with @method calcCoords(true); @@ -189,7 +189,7 @@ * @param {Fabric.Point} pointTL Top Left point * @param {Fabric.Point} pointBR Top Right point * @param {Boolean} calculate use coordinates of current position instead of .oCoords - * @return {Boolean} true if the objects containe the point + * @return {Boolean} true if the object contains the point */ _containsCenterOfCanvas: function(pointTL, pointBR, calculate) { // worst case scenario the object is so big that contains the screen @@ -294,7 +294,7 @@ /** * Returns coordinates of object's bounding rectangle (left, top, width, height) - * the box is intented as aligned to axis of canvas. + * the box is intended as aligned to axis of canvas. * @param {Boolean} [absolute] use coordinates without viewportTransform * @param {Boolean} [calculate] use coordinates of current position instead of .oCoords / .aCoords * @return {Object} Object with left, top, width, height properties @@ -305,7 +305,7 @@ }, /** - * Returns width of an object bounding box counting transformations + * Returns width of an object's bounding box counting transformations * before 2.0 it was named getWidth(); * @return {Number} width value */ @@ -382,7 +382,7 @@ }, /** - * Calculate and returns the .coords of an object. + * Calculates and returns the .coords of an object. * @return {Object} Object with tl, tr, br, bl .... * @chainable */ @@ -457,7 +457,7 @@ * Sets corner position coordinates based on current angle, width and height. * See {@link https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords|When-to-call-setCoords} * @param {Boolean} [ignoreZoom] set oCoords with or without the viewport transform. - * @param {Boolean} [skipAbsolute] skip calculation of aCoords, usefull in setViewportTransform + * @param {Boolean} [skipAbsolute] skip calculation of aCoords, useful in setViewportTransform * @return {fabric.Object} thisArg * @chainable */ @@ -505,10 +505,10 @@ }, /** - * calculate trasform Matrix that represent current transformation from - * object properties. - * @param {Boolean} [skipGroup] return transformMatrix for object and not go upward with parents - * @return {Array} matrix Transform Matrix for the object + * calculate transform matrix that represents the current transformations from the + * object's properties. + * @param {Boolean} [skipGroup] return transform matrix for object not counting parent transformations + * @return {Array} transform matrix for the object */ calcTransformMatrix: function(skipGroup) { if (skipGroup) { @@ -576,7 +576,7 @@ }, /* - * Calculate object bounding boxdimensions from its properties scale, skew. + * Calculate object bounding box dimensions from its properties scale, skew. * @private * @return {Object} .x width dimension * @return {Object} .y height dimension @@ -600,7 +600,7 @@ dimY = dimensions.y; } if (noSkew) { - return this._finalizeDiemensions(dimX * this.scaleX, dimY * this.scaleY); + return this._finalizeDimensions(dimX * this.scaleX, dimY * this.scaleY); } else { dimX /= 2; @@ -629,25 +629,25 @@ points[i] = fabric.util.transformPoint(points[i], transformMatrix); } bbox = fabric.util.makeBoundingBoxFromPoints(points); - return this._finalizeDiemensions(bbox.width, bbox.height); + return this._finalizeDimensions(bbox.width, bbox.height); }, /* - * Calculate object bounding boxdimensions from its properties scale, skew. + * Calculate object bounding box dimensions from its properties scale, skew. * @param Number width width of the bbox * @param Number height height of the bbox * @private * @return {Object} .x finalized width dimension * @return {Object} .y finalized height dimension */ - _finalizeDiemensions: function(width, height) { + _finalizeDimensions: function(width, height) { return this.strokeUniform ? { x: width + this.strokeWidth, y: height + this.strokeWidth } : { x: width, y: height }; }, /* - * Calculate object dimensions for controls. include padding and canvas zoom + * Calculate object dimensions for controls, including padding and canvas zoom. * private */ _calculateCurrentDimensions: function() {