Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #72 from iFixit/stroke-width-bugfix
Browse files Browse the repository at this point in the history
Bugfix: StrokeWidth
  • Loading branch information
djmetzle authored Sep 12, 2022
2 parents 12a55d6 + be991a7 commit 9382752
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ImageMarkupBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,15 @@ function ImageMarkupBuilder(fabricCanvas) {
}

function drawRectangle(shape) {
shape.stroke = getStrokeWidth(finalWidth);
shape.strokeWidth = getStrokeWidth(finalWidth);

var rect = {
left: shape.from.x - imageOffset.x,
top: shape.from.y - imageOffset.y,
width: shape.size.width,
height: shape.size.height,
borderWidth: shape.stroke,
stroke: colorValues[shape.color],
color: shape.color,
strokeWidth: shape.strokeWidth,
};

//Fabric調整
Expand All @@ -262,12 +261,11 @@ function ImageMarkupBuilder(fabricCanvas) {
}

function drawLineBasedShape(klass, shape) {
shape.stroke = getStrokeWidth(finalWidth);
shape.strokeWidth = getStrokeWidth(finalWidth);

var line = {
borderWidth: shape.stroke,
stroke: colorValues[shape.color],
color: shape.color,
strokeWidth: shape.strokeWidth,
};

var points = [
Expand All @@ -292,15 +290,14 @@ function ImageMarkupBuilder(fabricCanvas) {
}

function drawCircle(shape) {
shape.stroke = getStrokeWidth(finalWidth);
shape.strokeWidth = getStrokeWidth(finalWidth);

var circle = {
left: shape.from.x - imageOffset.x,
top: shape.from.y - imageOffset.y,
radius: shape.radius,
borderWidth: shape.stroke,
stroke: colorValues[shape.color],
color: shape.color,
strokeWidth: shape.strokeWidth,
};
circle.left *= resizeRatio;
circle.top *= resizeRatio;
Expand Down

0 comments on commit 9382752

Please sign in to comment.