Skip to content

Commit

Permalink
Fix Sample WPF
Browse files Browse the repository at this point in the history
- Add ref to Math.
- Rework code as needed.

***NO_CI***
  • Loading branch information
josesimoes committed Dec 1, 2023
1 parent fce4f5b commit 79f2821
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<HintPath>..\packages\nanoFramework.System.Device.Gpio.1.1.38\lib\System.Device.Gpio.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Math">
<HintPath>..\packages\nanoFramework.System.Math.1.5.43\lib\System.Math.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<ProjectExtensions>
Expand Down
1 change: 1 addition & 0 deletions samples/Graphics/SimpleWpf/SimpleWpf.Esp32/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<package id="nanoFramework.Runtime.Native" version="1.6.12" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Collections" version="1.5.31" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Device.Gpio" version="1.1.38" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.5.43" targetFramework="netnano1.0" />
</packages>
3 changes: 2 additions & 1 deletion samples/Graphics/SimpleWpf/SimpleWpf/SimpleWPFApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using nanoFramework.Runtime.Events;
using SimpleWpf;
using System.Drawing;
using Rectangle = nanoFramework.Presentation.Shapes.Rectangle;

namespace SimpleWPF
{
Expand Down Expand Up @@ -719,7 +720,7 @@ public override void OnRender(DrawingContext dc)
int scale = 0;

// Set the scaling offset based on the animation step.
int scaleOffset = Mathematics.Abs(_animationStep);
int scaleOffset = Math.Abs(_animationStep);

// Adjust the x based on the animation step.
x += _animationStep * 5;
Expand Down
3 changes: 3 additions & 0 deletions samples/Graphics/SimpleWpf/SimpleWpf/SimpleWpf.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<HintPath>..\packages\nanoFramework.System.Device.Gpio.1.1.38\lib\System.Device.Gpio.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Math">
<HintPath>..\packages\nanoFramework.System.Math.1.5.43\lib\System.Math.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<ProjectExtensions>
Expand Down
1 change: 1 addition & 0 deletions samples/Graphics/SimpleWpf/SimpleWpf/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<package id="nanoFramework.Runtime.Native" version="1.6.12" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Collections" version="1.5.31" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Device.Gpio" version="1.1.38" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.5.43" targetFramework="netnano1.0" />
</packages>

0 comments on commit 79f2821

Please sign in to comment.