From 0d64fa65d8e6e7027c9859ab15e519be15d5aba6 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 25 May 2020 08:36:07 -0700 Subject: [PATCH] Fix building snap misaligning view field item coordinates need to be even, not odd do the same "even" clamp (we do this so that we can sync the terrain tile view to the field item view) --- NHSE.WinForms/Subforms/Map/FieldItemEditor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs index 76e3bb5..26e4590 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs @@ -779,7 +779,9 @@ private void LoadIndex(int index) // -32 for relative offset on map (buildings can be placed on the exterior ocean acres) // -16 to put it in the center of the view const int shift = 48; - View.SetViewTo(b.X - shift, b.Y - shift); + var x = (b.X - shift) & 0xFFFE; + var y = (b.Y - shift) & 0xFFFE; + View.SetViewTo(x, y); } private void NUD_BuildingType_ValueChanged(object sender, EventArgs e)