Scale OxyPlot elements based on DPI

This commit is contained in:
David Wilhelm
2018-01-01 14:12:45 -08:00
parent 10e4975c6d
commit 5ded4049c4
2 changed files with 52 additions and 1 deletions
+22
View File
@@ -310,6 +310,28 @@ namespace OxyPlot
this.Subtitle = subtitle;
}
public PlotModel(double dpiXscale, double dpiYscale)
: this()
{
this.PlotMargins = new OxyThickness(this.PlotMargins.Left * dpiXscale,
this.PlotMargins.Top * dpiYscale,
this.PlotMargins.Right * dpiXscale,
this.PlotMargins.Bottom * dpiYscale
);
this.Padding = new OxyThickness(this.Padding.Left * dpiXscale,
this.Padding.Top * dpiYscale,
this.Padding.Right * dpiXscale,
this.Padding.Bottom * dpiYscale
);
this.TitlePadding *= dpiXscale;
this.LegendSymbolLength *= dpiXscale;
this.LegendSymbolMargin *= dpiXscale;
this.LegendPadding *= dpiXscale;
this.LegendColumnSpacing *= dpiXscale;
this.LegendItemSpacing *= dpiXscale;
this.LegendMargin *= dpiXscale;
}
/// <summary>
/// The synchronization root object.
/// </summary>