Save All is now working.
Size is now a relative value in Line.
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Progrart.Core.Graphics
|
||||
new SKPaint()
|
||||
{
|
||||
ColorF = Color,
|
||||
StrokeWidth = Size,
|
||||
StrokeWidth = context.TranslateSize(Size),
|
||||
Shader = shader
|
||||
}
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace Progrart.Core.Graphics
|
||||
{
|
||||
public class Rectangle : BaseElement
|
||||
public class Rectangle : BaseElement
|
||||
{
|
||||
|
||||
float StrokeWidth;
|
||||
@@ -78,7 +78,7 @@ namespace Progrart.Core.Graphics
|
||||
new SKPaint()
|
||||
{
|
||||
ColorF = Color,
|
||||
StrokeWidth = StrokeWidth,
|
||||
StrokeWidth = context.TranslateSize(StrokeWidth),
|
||||
Shader = shader
|
||||
}
|
||||
);
|
||||
|
||||
@@ -82,7 +82,11 @@ namespace Progrart.Core.JSExecution
|
||||
{
|
||||
height = (float)(js_height.AsNumber());
|
||||
}
|
||||
RenderContext renderContext = new RenderContext((int)(width * Scale), (int)(width * Scale));
|
||||
RenderContext renderContext = new RenderContext((int)(width * Scale), (int)(width * Scale))
|
||||
{
|
||||
LogicalW = width,
|
||||
LogicalH = height
|
||||
};
|
||||
ImageRoot imageRoot = new ImageRoot();
|
||||
|
||||
var img = engine.Engine.Call("main");
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Progrart.Core
|
||||
public PrimitiveDrawingCore DrawingCore { get; }
|
||||
|
||||
public SKCanvas canvas { get => DrawingCore.canvas; }
|
||||
public float LogicalW;
|
||||
public float LogicalH;
|
||||
public RenderContext(PrimitiveDrawingCore core)
|
||||
{
|
||||
this.DrawingCore = core;
|
||||
@@ -20,6 +22,10 @@ namespace Progrart.Core
|
||||
{
|
||||
return TranslatePoint(point.X, point.Y);
|
||||
}
|
||||
public float TranslateSize(float s)
|
||||
{
|
||||
return (float)(s * Math.Sqrt(DrawingCore.Width * DrawingCore.Width + DrawingCore.Height * DrawingCore.Height)/ Math.Sqrt(LogicalH * LogicalH + LogicalW * LogicalW));
|
||||
}
|
||||
public RenderContext(int W, int H)
|
||||
{
|
||||
DrawingCore = new PrimitiveDrawingCore(W, H);
|
||||
|
||||
Reference in New Issue
Block a user