Skip to content

Commit

Permalink
flipX
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Mar 6, 2022
1 parent 55c6ccc commit 5e129d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mixins/object_geometry.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
calcOCoords: function() {
var vpt = this.getViewportTransform(),
tMatrix = this._calcTranslateMatrix(true),
rMatrix = this._calcRotateMatrix(true, !!this.group),
rMatrix = this._calcRotateMatrix(true, true),
positionMatrix = multiplyMatrices(tMatrix, rMatrix),
startMatrix = multiplyMatrices(vpt, positionMatrix),
finalMatrix = multiplyMatrices(startMatrix, [1 / vpt[0], 0, 0, 1 / vpt[3], 0, 0]),
Expand Down
7 changes: 4 additions & 3 deletions src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@
_renderControls: function(ctx, styleOverride) {
var vpt = this.getViewportTransform(),
matrix = this.calcTransformMatrix(),
options, drawBorders, drawControls;
options, drawBorders, drawControls, angle;
styleOverride = styleOverride || { };
drawBorders = typeof styleOverride.hasBorders !== 'undefined' ? styleOverride.hasBorders : this.hasBorders;
drawControls = typeof styleOverride.hasControls !== 'undefined' ? styleOverride.hasControls : this.hasControls;
Expand All @@ -1399,10 +1399,11 @@
if (!this.group) {
ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
}
angle = this.group ? options.angle : this.angle;
if (this.flipX) {
options.angle -= 180;
angle -= 180;
}
ctx.rotate(degreesToRadians(this.group ? options.angle : this.angle));
ctx.rotate(degreesToRadians(angle));
if (drawBorders && (styleOverride.forActiveSelection || this.group)) {
this.drawBordersInGroup(ctx, options, styleOverride);
}
Expand Down

0 comments on commit 5e129d1

Please sign in to comment.