mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[Screen Ruler] Better error handling and reuse D3D device (#20223)
* [Screen Ruler] simplify lines calculation * [Screen Ruler] Add inches and centimeters support * [Chore] prefer x64 toolset to avoid hitting C1076 * [Screen Ruler] Allow making screenshots in non-continuous mode * [Screen Ruler] Use single d3d device for all ops * [Screen Ruler] remove gpu mutex and clean up screen capturing * [Screen Ruler] handle and log DXGI initialization failure * [Screen Ruler] Add unhandled exception handler * [Screen Ruler] comment out Units of Measure setting * [Screen Ruler] introduce a separate device dedicated for capturing
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
public MeasureToolProperties()
|
||||
{
|
||||
ActivationShortcut = new HotkeySettings(true, false, false, true, 0x4D);
|
||||
UnitsOfMeasure = new IntProperty(0);
|
||||
PixelTolerance = new IntProperty(30);
|
||||
ContinuousCapture = true;
|
||||
DrawFeetOnCross = true;
|
||||
@@ -32,6 +33,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
||||
public bool PerColorChannelEdgeDetection { get; set; }
|
||||
|
||||
public IntProperty UnitsOfMeasure { get; set; }
|
||||
|
||||
public IntProperty PixelTolerance { get; set; }
|
||||
|
||||
public StringProperty MeasureCrossColor { get; set; }
|
||||
|
||||
@@ -129,6 +129,23 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public int UnitsOfMeasure
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.Properties.UnitsOfMeasure.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (Settings.Properties.UnitsOfMeasure.Value != value)
|
||||
{
|
||||
Settings.Properties.UnitsOfMeasure.Value = value;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int PixelTolerance
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user