MInor performance increase
parent
5b10418f1a
commit
fabead4e65
|
@ -16,6 +16,7 @@ public partial class TouchPanel : Window
|
||||||
private readonly Dictionary<int, Polygon> activeTouches = [];
|
private readonly Dictionary<int, Polygon> activeTouches = [];
|
||||||
private readonly TouchPanelPositionManager _positionManager;
|
private readonly TouchPanelPositionManager _positionManager;
|
||||||
private List<Polygon> buttons = [];
|
private List<Polygon> buttons = [];
|
||||||
|
private bool isDebugEnabled = Properties.Settings.Default.IsDebugEnabled;
|
||||||
|
|
||||||
private enum ResizeDirection
|
private enum ResizeDirection
|
||||||
{
|
{
|
||||||
|
@ -168,6 +169,7 @@ public partial class TouchPanel : Window
|
||||||
|
|
||||||
public void SetDebugMode(bool enabled)
|
public void SetDebugMode(bool enabled)
|
||||||
{
|
{
|
||||||
|
isDebugEnabled = enabled;
|
||||||
buttons.ForEach(button =>
|
buttons.ForEach(button =>
|
||||||
{
|
{
|
||||||
button.Opacity = enabled ? 0.3 : 0;
|
button.Opacity = enabled ? 0.3 : 0;
|
||||||
|
@ -176,7 +178,7 @@ public partial class TouchPanel : Window
|
||||||
|
|
||||||
private void HighlightElement(Polygon element, bool highlight)
|
private void HighlightElement(Polygon element, bool highlight)
|
||||||
{
|
{
|
||||||
if (Properties.Settings.Default.IsDebugEnabled)
|
if (isDebugEnabled)
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue