mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-04-21 06:13:58 +00:00
minor tweaks
This commit is contained in:
parent
fbfe89c704
commit
3f8a7d4b8f
3 changed files with 39 additions and 19 deletions
|
|
@ -69,7 +69,11 @@ namespace SampleApp.WinDesktop
|
|||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debugger.Break();
|
||||
if(!stream.CanRead)
|
||||
{
|
||||
// TODO: Restart stream
|
||||
return;
|
||||
}
|
||||
}
|
||||
var device = MainWindow.currentDevice;
|
||||
if (device != null && device.CanWrite)
|
||||
|
|
|
|||
|
|
@ -105,12 +105,10 @@ namespace SampleApp.WinDesktop
|
|||
if (autoFit)
|
||||
{
|
||||
maxDif = distances.Max();
|
||||
if (maxDif < .1)
|
||||
maxDif = .1;
|
||||
if (maxDif < .25)
|
||||
maxDif = .25;
|
||||
else if (maxDif < .5)
|
||||
maxDif = .5;
|
||||
if (maxDif < 0.05)
|
||||
maxDif = 0.05;
|
||||
else if (maxDif < 1)
|
||||
maxDif = Math.Ceiling(maxDif * 10) / 10d;
|
||||
else
|
||||
maxDif = Math.Ceiling(maxDif);
|
||||
currentScale = maxDif / (Math.Min(size.Width, size.Height) * .5);
|
||||
|
|
@ -253,12 +251,10 @@ namespace SampleApp.WinDesktop
|
|||
maxDif = e.Delta < 0 ? maxDif * 2 : maxDif / 2;
|
||||
else
|
||||
maxDif = e.Delta < 0 ? maxDif + 1 : maxDif - 1;
|
||||
if (maxDif < .1)
|
||||
maxDif = .1;
|
||||
if (maxDif < .25)
|
||||
maxDif = .25;
|
||||
else if (maxDif < .5)
|
||||
maxDif = .5;
|
||||
if (maxDif < 0.05)
|
||||
maxDif = 0.05;
|
||||
else if (maxDif < 1)
|
||||
maxDif = Math.Ceiling(maxDif * 10) / 10d;
|
||||
else
|
||||
maxDif = Math.Ceiling(maxDif);
|
||||
currentScale = maxDif / (Math.Min(size.Width, size.Height) * .5);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue