Skip to content

Commit f4b7fef

Browse files
authored
Merge pull request #5926 from bubblobill/shape_id_fix
Fix Drawing ID not unique on shape.draw()
2 parents 1f11c5f + 88bdce1 commit f4b7fef

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ dependencies {
360360
implementation(libs.okhttp)
361361

362362
implementation(libs.bundles.imageio)
363-
implementation(libs.batik)
363+
implementation(libs.bundles.batik)
364364
implementation(libs.bundles.pdfbox)
365365
implementation(libs.bcmail)
366366
implementation(libs.bundles.jai.imageio)

common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies {
1616
implementation(libs.gson)
1717

1818
implementation(libs.bundles.imageio)
19-
implementation(libs.batik)
19+
implementation(libs.bundles.batik)
2020
implementation(libs.jsvg)
2121

2222
implementation(libs.apache.commons.io)

gradle/libs.versions.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ imageio-tiff = { group = "com.twelvemonkeys.imageio", name = "imageio-tiff", ver
5252
imageio-batik = { group = "com.twelvemonkeys.imageio", name = "imageio-batik", version.ref = "imageio" }
5353
imageio-tga = { group = "com.twelvemonkeys.imageio", name = "imageio-tga", version.ref = "imageio" }
5454
imageio-bmp = { group = "com.twelvemonkeys.imageio", name = "imageio-bmp", version.ref = "imageio" }
55-
batik = { group = "org.apache.xmlgraphics", name = "batik-all", version = "1.19" }
55+
56+
batik-all = { group = "org.apache.xmlgraphics", name = "batik-all", version = "1.19" }
57+
batik-awt = { group = "org.apache.xmlgraphics", name="batik-awt-util", version = "1.19" }
58+
batik-transcoder = { group = "org.apache.xmlgraphics", name="batik-transcoder", version = "1.19" }
59+
5660
# PDF image extraction
5761
pdfbox = { group = "org.apache.pdfbox", name = "pdfbox", version.ref = "pdfbox" }
5862
pdfbox-tools = { group = "org.apache.pdfbox", name = "pdfbox-tools", version.ref = "pdfbox" }
@@ -191,6 +195,7 @@ imageio = [
191195
"imageio-tga",
192196
"imageio-bmp",
193197
]
198+
batik = ["batik-all", "batik-awt", "batik-transcoder"]
194199
pdfbox = ["pdfbox", "pdfbox-tools"]
195200
jide = [
196201
"jide-common",

src/main/java/net/rptools/maptool/client/functions/ShapeFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ private Object drawShape(
576576
pen.setEraser(penObject.get("eraser").getAsBoolean());
577577
}
578578
}
579-
DrawnElement drawnElement = new DrawnElement(CACHED_SHAPES.get(shapeName), pen);
579+
DrawnElement drawnElement = new DrawnElement(shapeDrawable.copy(), pen);
580580
drawnElement.setPen(pen);
581581

582582
MapTool.serverCommand()

src/main/java/net/rptools/maptool/model/drawing/AbstractDrawing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected AbstractDrawing(GUID id) {
4747

4848
protected AbstractDrawing(AbstractDrawing other) {
4949
// The only thing we don't preserve is the ID.
50-
this.id = other.id;
50+
this.id = new GUID();
5151
this.layer = other.layer;
5252
this.name = other.name;
5353
}

0 commit comments

Comments
 (0)