Skip to content

Commit a8694a2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 4aa63ab + 3e42aaf commit a8694a2

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/TSMapEditor/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace TSMapEditor
44
{
55
public static class Constants
66
{
7-
public const string ReleaseVersion = "1.7.1";
7+
public const string ReleaseVersion = "1.7.2";
88

99
public static int CellSizeX = 48;
1010
public static int CellSizeY = 24;

src/TSMapEditor/Rendering/ObjectRenderers/UnitRenderer.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,12 @@ protected override DepthRectangle GetDepthFromPosition(Unit gameObject, Rectangl
5353
float max = Math.Max(depthTop, depthBottom);
5454

5555
// The unit's body is always drawn first, and at that point cachedDepth is -1f.
56-
// For the body, use the depth values computed here, otherwise use the largest depth recorded so far.
57-
if (cachedDepth.TopLeft < 0f)
56+
// For the shadow and body, use the depth values computed here, otherwise use the largest depth recorded so far.
57+
if (cachedDepth.TopLeft < max)
5858
{
5959
cachedDepth = new DepthRectangle(max);
6060
return new DepthRectangle(depthTop, depthBottom);
6161
}
62-
else if (cachedDepth.TopLeft < max)
63-
{
64-
cachedDepth = new DepthRectangle(max);
65-
}
6662

6763
return cachedDepth;
6864
}

src/TSMapEditor/UI/Sidebar/TreeView.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,17 @@ public void FindNode(string text, bool findNext)
226226
SelectedNode = foundNode;
227227

228228
// Scroll the view to the found item
229-
int totalHeight = GetTotalContentHeight();
230-
if (accumulatedHeight + Height > totalHeight)
231-
accumulatedHeight = totalHeight - Height;
229+
int contentHeight = GetTotalContentHeight();
230+
if (accumulatedHeight + LineHeight + MARGIN > ViewTop + Height)
231+
{
232+
ViewTop += accumulatedHeight + LineHeight + MARGIN - (ViewTop + Height);
233+
}
234+
else if (accumulatedHeight < ViewTop)
235+
{
236+
ViewTop = accumulatedHeight - LineHeight;
237+
}
232238

233239
RefreshScrollbar();
234-
ViewTop = accumulatedHeight;
235240
}
236241
}
237242

src/TSMapEditor/UI/Windows/TaskforcesWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private void ShowTaskForceReferences()
349349

350350
EditorMessageBox.Show(WindowManager,
351351
Translate(this, "ReferencesFound.Title", "TaskForce References"),
352-
string.Format(Translate(this, "ReferencesFound.Description", "{The selected TaskForce \"{0}\" ({1}) is used by the following TeamTypes:}" + Environment.NewLine + Environment.NewLine + "{2}"),
352+
string.Format(Translate(this, "ReferencesFound.Description", "The selected TaskForce \"{0}\" ({1}) is used by the following TeamTypes:" + Environment.NewLine + Environment.NewLine + "{2}"),
353353
editedTaskForce.Name, editedTaskForce.ININame, stringBuilder.ToString()),
354354
MessageBoxButtons.OK);
355355
}

0 commit comments

Comments
 (0)