fix(html): fix hashCode for triangle
The bug caused HTML class and CSS selector to have different IDs, breaking triangle rendering.
This commit was merged in pull request #20.
This commit is contained in:
@@ -66,11 +66,11 @@ public class HTMLDraftman implements ShapeVisitor {
|
||||
|
||||
@Override
|
||||
public void visitTriangle(STriangle sTriangle) {
|
||||
htmlOutput.printf("<div class=\"triangle%d\"></div>\n", this.hashCode());
|
||||
htmlOutput.printf("<div class=\"triangle%d\"></div>\n", sTriangle.hashCode());
|
||||
var bounds = sTriangle.getBounds();
|
||||
ColorAttributes colAttrs = (ColorAttributes) sTriangle.getAttributes(ColorAttributes.ID);
|
||||
String colorString = formatCSSColor(colAttrs.filledColor);
|
||||
StringJoiner joiner = new StringJoiner("\n", ".triangle%d{\n".formatted(this.hashCode()), "\n}\n");
|
||||
StringJoiner joiner = new StringJoiner("\n", ".triangle%d{\n".formatted(sTriangle.hashCode()), "\n}\n");
|
||||
joiner.add(" position: absolute;");
|
||||
joiner.add(" top: %dpx;".formatted(bounds.y));
|
||||
joiner.add(" left: %dpx;".formatted(bounds.x));
|
||||
|
||||
Reference in New Issue
Block a user