Skip to content

Commit

Permalink
WCAG. Update line width detection
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Jan 6, 2025
1 parent 88bf4e0 commit c8119c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ private LineChunk transformLineChunk(LineChunk lineChunk, double lineWidth, int
graphicsState.getCTM().transformY(lineChunk.getStartX(), lineChunk.getStartY()),
graphicsState.getCTM().transformX(lineChunk.getEndX(), lineChunk.getEndY()),
graphicsState.getCTM().transformY(lineChunk.getEndX(), lineChunk.getEndY()),
lineWidth, lineCap);
lineWidth * graphicsState.getCTM().getScaleValue(), lineCap);
}

private static void processColorSpace(GraphicsState graphicState, ResourceHandler resourcesHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ public Vertex transformVertex(Vertex v) {
public double getRotationDegree() {
return Math.toDegrees(Math.atan2(getShearY(), getScaleX()));
}

public double getScaleValue() {
return Math.max(Math.sqrt(getScaleY() * getScaleY() + getShearX() * getShearX()),
Math.sqrt(getScaleX() * getScaleX() + getShearY() * getShearY()));
}

@Override
public String toString() {
Expand Down

0 comments on commit c8119c1

Please sign in to comment.