Skip to content

Commit

Permalink
fix: makes the border mode on the fill tool not double place on corne…
Browse files Browse the repository at this point in the history
…rs (#329)
  • Loading branch information
mc-oofert authored Dec 7, 2024
1 parent ed28171 commit ba587db
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions internal/app/ui/cpwsarea/wsmap/tools/fill.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,12 @@ func (t *ToolFill) onStop(util.Point) {
t.basicPrefabAdd(tile, prefab)
}
if imguiext.IsCtrlDown() {
rows := []float32{t.fillArea.Y1, t.fillArea.Y2}
columns := []float32{t.fillArea.X1, t.fillArea.X2}
for x := t.fillArea.X1; x <= t.fillArea.X2; x++ {
for _, coordinate := range rows {
fillTile(int(x), int(coordinate))
}
}
for y := t.fillArea.Y1; y <= t.fillArea.Y2; y++ {
for _, coordinate := range columns {
fillTile(int(coordinate), int(y))
for y := t.fillArea.Y1; y <= t.fillArea.Y2; y++ {
if y > t.fillArea.Y1 && y < t.fillArea.Y2 && x > t.fillArea.X1 && x < t.fillArea.X2 {
continue
}
fillTile(int(x), int(y))
}
}
} else {
Expand Down

0 comments on commit ba587db

Please sign in to comment.