Latest
This commit is contained in:
@@ -212,8 +212,6 @@ public sealed partial class MainWindow
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
SetHoveredCell(point.Position);
|
||||
}
|
||||
|
||||
private void LevelCanvas_PointerReleased(object sender, PointerRoutedEventArgs e)
|
||||
@@ -228,11 +226,6 @@ public sealed partial class MainWindow
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void LevelCanvas_PointerExited(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
ClearHoveredCell();
|
||||
}
|
||||
|
||||
private void LevelCanvas_PointerWheelChanged(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
var point = e.GetCurrentPoint(LevelCanvas);
|
||||
@@ -346,13 +339,10 @@ public sealed partial class MainWindow
|
||||
if (cell.Hazards.Fire)
|
||||
DrawImage(drawing, m_FireSprite, Inset(rect, 0.08));
|
||||
|
||||
DrawCellProp(drawing, cell, rect);
|
||||
|
||||
if (m_HoveredCell == position)
|
||||
drawing.FillRectangle(rect, ColorHelper.FromArgb(72, 255, 255, 255));
|
||||
|
||||
if (m_SelectedCell == position)
|
||||
drawing.DrawRectangle(rect, Colors.White, 3);
|
||||
|
||||
DrawCellProp(drawing, cell, rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -529,25 +519,6 @@ public sealed partial class MainWindow
|
||||
return m_Level.InBounds(position);
|
||||
}
|
||||
|
||||
private void SetHoveredCell(Point point)
|
||||
{
|
||||
var hoveredCell = TryGetGridPosition(point, out var position) ? position : (GridPosition?)null;
|
||||
if (m_HoveredCell == hoveredCell)
|
||||
return;
|
||||
|
||||
m_HoveredCell = hoveredCell;
|
||||
LevelCanvas.Invalidate();
|
||||
}
|
||||
|
||||
private void ClearHoveredCell()
|
||||
{
|
||||
if (m_HoveredCell is null)
|
||||
return;
|
||||
|
||||
m_HoveredCell = null;
|
||||
LevelCanvas.Invalidate();
|
||||
}
|
||||
|
||||
private CanvasLayout GetLayout()
|
||||
{
|
||||
ClampPan();
|
||||
@@ -733,7 +704,7 @@ public sealed partial class MainWindow
|
||||
private const double c_MinZoom = 0.5;
|
||||
private const double c_MaxZoom = 4;
|
||||
private const double c_ZoomStep = 1.15;
|
||||
private const double c_ClickPixelThreshold = 5;
|
||||
private const double c_ClickPixelThreshold = 10;
|
||||
|
||||
private readonly SimulationEngine m_Simulation = new();
|
||||
private readonly Dictionary<ECellProp, CanvasBitmap> m_PropSprites = [];
|
||||
@@ -745,7 +716,6 @@ public sealed partial class MainWindow
|
||||
private bool m_DragExceededClickThreshold;
|
||||
private Point m_LeftPointerDownPoint;
|
||||
private Point m_LastPanPoint;
|
||||
private GridPosition? m_HoveredCell;
|
||||
private GridPosition? m_SelectedCell;
|
||||
private EEditorTool m_SelectedTool = EEditorTool.Cursor;
|
||||
private double m_Zoom = 1;
|
||||
|
||||
Reference in New Issue
Block a user