Skip to content

Commit

Permalink
polygon labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticdrew committed Jun 20, 2024
1 parent d586daf commit 8aececf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ internal fun polygonsGet(ctx: io.javalin.http.Context)
{
val polygon = step.overlay as PolygonOverlay
val points = mutableListOf<Map<String, Int>>()
val label = polygon.label
var fontColor = polygon?.textProperties?.color
if(fontColor == null) {
fontColor = RGB.BLACK_RGB
}

polygon.outerArea.points.forEach { point ->
points.add(
Expand Down Expand Up @@ -82,7 +87,8 @@ internal fun polygonsGet(ctx: io.javalin.http.Context)
"texturePositionY" to polygon.shapeProperties.texturePositionY,
"textureScaleX" to polygon.shapeProperties.textureScaleX,
"textureScaleY" to polygon.shapeProperties.textureScaleY,

"fontColor" to RGB.toHexString(fontColor),
"label" to label,
"holes" to holes,
"points" to points
)
Expand Down
2 changes: 1 addition & 1 deletion doc/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ <h1>JourneyMap WebMap ${version} for Minecraft ${mcversion}</h1>

<p>New in ${version}</p>
<ul>

<li>Add: Labels to polygons</li>
</ul>

0 comments on commit 8aececf

Please sign in to comment.