Skip to content

Commit

Permalink
fix(): account for padding
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Mar 8, 2022
1 parent f70019b commit 47f018d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mixins/object_interactivity.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
var bbox = fabric.util.sizeAfterTransform(this.width, this.height, options),
strokeWidth = this.strokeWidth,
strokeUniform = this.strokeUniform,
borderScaleFactor = this.borderScaleFactor,
borderScaleFactor = this.borderScaleFactor + this.padding * 2,
width =
bbox.x + strokeWidth * (strokeUniform ? this.canvas.getZoom() : options.scaleX) + borderScaleFactor,
height =
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/group.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@
var objCenter, sizeVector, min, max, a, b;
objects.forEach(function (object, i) {
objCenter = object.getRelativeCenterPoint();
sizeVector = object._getTransformedDimensions().scalarDivideEquals(2);
sizeVector = object._getTransformedDimensions().scalarDivideEquals(2).scalarAddEquals(object.padding);
if (object.angle) {
var rad = degreesToRadians(object.angle),
sin = Math.abs(fabric.util.sin(rad)),
Expand Down

0 comments on commit 47f018d

Please sign in to comment.