Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
#186 - Store resolution in private field against GenericPort so all s…
Browse files Browse the repository at this point in the history
…ubclasses benefit from it if not overridden further.
  • Loading branch information
techyian committed Oct 14, 2020
1 parent d3ef1e7 commit 3f02ee7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MMALSharp/Ports/GenericPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ namespace MMALSharp.Ports
public class GenericPort<TCallback> : PortBase<TCallback>
where TCallback : ICallbackHandler
{
private Resolution _resolution;

/// <inheritdoc />
public override Resolution Resolution
{
get => new Resolution(this.NativeWidth, this.NativeHeight);
get
{
return _resolution;
}

internal set
{
this.NativeWidth = value.Pad().Width;
this.NativeHeight = value.Pad().Height;
_resolution = new Resolution(value.Width, value.Height);
}
}

Expand Down

0 comments on commit 3f02ee7

Please sign in to comment.