-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pdf creation + small fixes inside SvgSection #916
Conversation
…ent to customize drawing creation;
…ent to customize drawing creation;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @katehryhorenko)
Elements.Serialization.SVG/src/Elements.Serialization.SVG.csproj
line 21 at r1 (raw file):
<PackageReference Include="Svg.Skia" Version="0.6.0-preview2"/> <PackageReference Include="SkiaSharp" Version="2.88.3"/> <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3"/>
Is this required when you're not running on the lambda? I know that packages can do cool stuff like pull down platform dependencies depending on how they're built. Just wondering if need to always include this.
Elements.Serialization.SVG/src/Elements.Serialization.SVG.csproj
line 29 at r1 (raw file):
<ItemGroup> <None Include="libSkiaSharp.so" Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
I've never had to do this for a nuget package that targets Linux. Is this required?
I'm getting up to date here: mono/SkiaSharp#312 (comment). But I'm still not 100% sure that this is required.
Elements.Serialization.SVG/src/SvgSection.cs
line 38 at r1 (raw file):
/// <summary> ///
Empty docs make me sad. May I suggest. A section of a model serialized to SVG.
Elements.Serialization.SVG/src/SvgSection.cs
line 45 at r1 (raw file):
/// <summary> /// This event occurs before element is added to the svg scene.
"...before an element is added..."
Elements.Serialization.SVG/src/SvgSection.cs
line 57 at r1 (raw file):
/// Initializes a new instance of SvgDrawingPlan class /// </summary> /// <param name="models">A collection of models to include in the plan</param>
"A collection of models to include in the plan." (note the period) All of these doc comments can end in a period.
Elements.Serialization.SVG/src/SvgSection.cs
line 88 at r1 (raw file):
/// <summary> /// Gets or sets an svg context which defines settings for grid elements
I usually don't say "Gets or sets" because one day we'll decide we don't want to "set" anymore and we'll forget to update the docs. I recommend "The svg context which defines settings for the grid elements." The developer tooling does a pretty good job of telling the user if you can get and set.
Elements.Serialization.SVG/src/SvgSection.cs
line 302 at r1 (raw file):
}
Whitespace
Elements.Serialization.SVG/src/SvgSection.cs
line 401 at r1 (raw file):
private static BBox3 ComputeSceneBounds(IList<Model> models) { var max = new Vector3(double.MinValue, double.MinValue);
I've written this exact same code numerous times. Can we add convenience constructors Vector3.Max
and Vector3.Min
?
Elements.Serialization.SVG/src/SvgSection.cs
line 413 at r1 (raw file):
geo.UpdateBoundsAndComputeSolid(); if (geo._bounds.Max.X > max.X)
Can we replace this block with geo._bounds.Extend(new[]{max,min})
?
Elements.Serialization.SVG/src/SvgSection.cs
line 444 at r1 (raw file):
foreach (var model in models) { var modelWithoutCusromElements = model;
modelWithoutCustomElements
Elements.Serialization.SVG/src/SvgSection.cs
line 600 at r1 (raw file):
#region Private fields private readonly List<Model> models = new List<Model>();
Our general practice is to put private fields at the top of the class and to use C# coding guidelines with camel-cased, prefixed members: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions#camel-case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @ikeough and @katehryhorenko)
Elements.Serialization.SVG/src/Elements.Serialization.SVG.csproj
line 21 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
Is this required when you're not running on the lambda? I know that packages can do cool stuff like pull down platform dependencies depending on how they're built. Just wondering if need to always include this.
Yes, it's for lambda
Elements.Serialization.SVG/src/Elements.Serialization.SVG.csproj
line 29 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
I've never had to do this for a nuget package that targets Linux. Is this required?
I'm getting up to date here: mono/SkiaSharp#312 (comment). But I'm still not 100% sure that this is required.
Yes, it didn't work without this file
Elements.Serialization.SVG/src/SvgSection.cs
line 38 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
Empty docs make me sad. May I suggest.
A section of a model serialized to SVG.
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 45 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
"...before an element is added..."
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 88 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
I usually don't say "Gets or sets" because one day we'll decide we don't want to "set" anymore and we'll forget to update the docs. I recommend "The svg context which defines settings for the grid elements." The developer tooling does a pretty good job of telling the user if you can get and set.
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 302 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
Whitespace
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 401 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
I've written this exact same code numerous times. Can we add convenience constructors
Vector3.Max
andVector3.Min
?
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 413 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
Can we replace this block with
geo._bounds.Extend(new[]{max,min})
?
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 444 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
modelWithoutCustomElements
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 600 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
Our general practice is to put private fields at the top of the class and to use C# coding guidelines with camel-cased, prefixed members: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions#camel-case
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @katehryhorenko)
Elements/src/Geometry/Vector3.cs
line 79 at r2 (raw file):
/// <summary> /// The smallest possible value of a Elements.Vector
Recommend "The smallest possible value of a Vector3."
Elements/src/Geometry/Vector3.cs
line 87 at r2 (raw file):
/// <summary> /// The largest possible value of a Elements.Vector
Recommend "The largest possible value of a Vector3."
Elements.Serialization.SVG/src/SvgSection.cs
line 112 at r2 (raw file):
/// <summary> /// Gets or sets if gridlines exist, should they be shown in the plan.
Missed one! Recommend "Should grid lines be shown in the section?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @ikeough)
Elements/src/Geometry/Vector3.cs
line 79 at r2 (raw file):
Previously, ikeough (Ian Keough) wrote…
Recommend "The smallest possible value of a Vector3."
Done.
Elements/src/Geometry/Vector3.cs
line 87 at r2 (raw file):
Previously, ikeough (Ian Keough) wrote…
Recommend "The largest possible value of a Vector3."
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 57 at r1 (raw file):
Previously, ikeough (Ian Keough) wrote…
"A collection of models to include in the plan." (note the period) All of these doc comments can end in a period.
Done.
Elements.Serialization.SVG/src/SvgSection.cs
line 112 at r2 (raw file):
Previously, ikeough (Ian Keough) wrote…
Missed one! Recommend "Should grid lines be shown in the section?"
Done.
BACKGROUND:
We need to convert svg to pdf
DESCRIPTION:
doc.ViewBox = new SvgViewBox((wOld - ViewBoxWidth) / 2.0f, (ViewBoxHeight - hOld) / 2.0f, ViewBoxWidth, ViewBoxHeight);
doc.CustomAttributes.Add("transform", $"rotate({rotation} {ViewBoxWidth / 2.0} {ViewBoxHeight / 2.0})");
REQUIRED:
CHANGELOG.md
.This change is