Skip to content

Commit 1630bcc

Browse files
added stroke position to ShapeProperties
1 parent 415e570 commit 1630bcc

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

common/src/main/java/journeymap/api/v2/client/model/ShapeProperties.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class ShapeProperties
3939
private float strokeOpacity = 1f;
4040
private float fillOpacity = .5f;
4141
private float strokeWidth = 2;
42+
private StrokePosition strokePosition = StrokePosition.CENTER;
4243
private NativeImage image;
4344
private ResourceLocation imageLocation;
4445
private double texturePositionX = 0;
@@ -156,6 +157,28 @@ public ShapeProperties setStrokeWidth(float strokeWidth)
156157
return this;
157158
}
158159

160+
/**
161+
* Gets the stroke position.
162+
*
163+
* @return position
164+
*/
165+
public StrokePosition getStrokePosition()
166+
{
167+
return strokePosition;
168+
}
169+
170+
/**
171+
* Sets the stroke position.
172+
*
173+
* @param strokePosition position
174+
* @return this
175+
*/
176+
public ShapeProperties setStrokePosition(StrokePosition strokePosition)
177+
{
178+
this.strokePosition = strokePosition;
179+
return this;
180+
}
181+
159182
/**
160183
* Gets the image, if there is one.
161184
*
@@ -307,6 +330,7 @@ public boolean equals(Object o)
307330
Objects.equal(strokeOpacity, that.strokeOpacity) &&
308331
Objects.equal(fillOpacity, that.fillOpacity) &&
309332
Objects.equal(strokeWidth, that.strokeWidth) &&
333+
Objects.equal(strokePosition, that.strokePosition) &&
310334
Objects.equal(imageLocation, that.imageLocation) &&
311335
Objects.equal(texturePositionX, that.texturePositionX) &&
312336
Objects.equal(texturePositionY, that.texturePositionY) &&
@@ -317,7 +341,7 @@ public boolean equals(Object o)
317341
@Override
318342
public int hashCode()
319343
{
320-
return Objects.hashCode(strokeColor, fillColor, strokeOpacity, fillOpacity, strokeWidth, imageLocation, texturePositionX, texturePositionY, textureScaleX, textureScaleY);
344+
return Objects.hashCode(strokeColor, fillColor, strokeOpacity, fillOpacity, strokeWidth, strokePosition, imageLocation, texturePositionX, texturePositionY, textureScaleX, textureScaleY);
321345
}
322346

323347
@Override
@@ -329,6 +353,7 @@ public String toString()
329353
.add("strokeColor", strokeColor)
330354
.add("strokeOpacity", strokeOpacity)
331355
.add("strokeWidth", strokeWidth)
356+
.add("strokePosition", strokePosition)
332357
.add("imageLocation", imageLocation)
333358
.add("texturePositionX", texturePositionX)
334359
.add("texturePositionY", texturePositionY)
@@ -338,4 +363,11 @@ public String toString()
338363
}
339364

340365

366+
public enum StrokePosition
367+
{
368+
INSIDE,
369+
CENTER,
370+
OUTSIDE
371+
}
372+
341373
}

0 commit comments

Comments
 (0)