mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-19 19:01:52 +00:00
only one object for style (#3899)
This commit is contained in:
parent
ee323e126f
commit
b4761f3459
1 changed files with 6 additions and 7 deletions
|
|
@ -1307,16 +1307,15 @@
|
|||
/**
|
||||
* Renders controls and borders for the object
|
||||
* @param {CanvasRenderingContext2D} ctx Context to render on
|
||||
* @param {Object} [styleOverride] properties to override the object style
|
||||
*/
|
||||
_renderControls: function(ctx, bordersStyle, controlsStyle) {
|
||||
_renderControls: function(ctx, styleOverride) {
|
||||
var vpt = this.getViewportTransform(),
|
||||
matrix = this.calcTransformMatrix(),
|
||||
options;
|
||||
styleOverride = styleOverride || { };
|
||||
matrix = fabric.util.multiplyTransformMatrices(vpt, matrix);
|
||||
options = fabric.util.qrDecompose(matrix);
|
||||
if (controlsStyle && bordersStyle) {
|
||||
bordersStyle.hasRotatingPoint = controlsStyle.hasRotatingPoint;
|
||||
}
|
||||
ctx.save();
|
||||
ctx.translate(options.translateX, options.translateY);
|
||||
ctx.lineWidth = 1 * this.borderScaleFactor;
|
||||
|
|
@ -1325,13 +1324,13 @@
|
|||
}
|
||||
if (this.group && this.group === this.canvas.getActiveGroup()) {
|
||||
ctx.rotate(degreesToRadians(options.angle));
|
||||
(this.hasBorders || bordersStyle) && this.drawBordersInGroup(ctx, options, bordersStyle);
|
||||
(this.hasBorders || styleOverride.hasBorders) && this.drawBordersInGroup(ctx, options, styleOverride);
|
||||
}
|
||||
else {
|
||||
ctx.rotate(degreesToRadians(this.angle));
|
||||
(this.hasBorders || bordersStyle) && this.drawBorders(ctx, bordersStyle);
|
||||
(this.hasBorders || styleOverride.hasBorders) && this.drawBorders(ctx, styleOverride);
|
||||
}
|
||||
(this.hasControls || controlsStyle) && this.drawControls(ctx, controlsStyle);
|
||||
(this.hasControls || styleOverride.hasControls) && this.drawControls(ctx, styleOverride);
|
||||
ctx.restore();
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue