From 2ce10cea15c0ac19907dddd2b0a435d1cd688b72 Mon Sep 17 00:00:00 2001 From: Chad Cuddigan Date: Wed, 12 Dec 2018 09:38:44 -0800 Subject: [PATCH] Default editor carve size is based on the picked wall texture atlas rowScale --- .../com/interrupt/dungeoneer/editor/EditorFrame.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java b/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java index 482d3ad9..5c1e38be 100644 --- a/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java +++ b/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java @@ -820,7 +820,9 @@ else if(pickedSurface.tileSurface == TileSurface.Ceiling) { if(!selected) selectionHeights.set(t.ceilHeight, selZ); } else { - if(!selected) selectionHeights.set(0.5f, -0.5f); + TextureAtlas atlas = TextureAtlas.getRepeatingAtlasByIndex(pickedWallTextureAtlas); + float size = atlas.rowScale * atlas.scale; + if(!selected) selectionHeights.set(size - 0.5f, -0.5f); } if(slopePointMode || slopeEdgeMode) @@ -4046,6 +4048,12 @@ public void doCarve() { t.floorHeight = selectedTile.floorHeight; t.ceilHeight = selectedTile.ceilHeight; + if(pickedSurface == null || !pickedSurface.isPicked) { + TextureAtlas atlas = TextureAtlas.getRepeatingAtlasByIndex(pickedWallTextureAtlas); + float size = atlas.rowScale * atlas.scale; + t.ceilHeight = size - 0.5f; + } + t.floorHeight = selectionHeights.y; setTile(t);