Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Graphics class and every related class, struct and enum (#20
) * add Matrix class * add StringFormat class and referenced enum/classes * add GraphicsPath and its dependencies (except for Pen, Brush and Graphics classes) * add Brush class * add SolidBrush class * add Brushes class * add TextureBrush class and WrapMode enum * add HatchBrush style and HatchStyle enum * add LinearGradientBrush class and referenced enum/classes * add PathGradientBrush class * add Pen class and referenced enums * add GraphicsPath class methods' implementation depending on Pen and Brush * add Region class and RegionDataClass class, update RectangleF with required methods/properties * add Graphics and referenced enum/class, update references from other classes * fix indentation spaces by tabs * fix Region.GetBounds signature and fix error when Graphics parameter is null * fix methods depending on Graphics class (TODOs) * add Region class test-cases * fix Region.IsVisible method considering Graphics parameter * minor: remove unrequired usings in tests * define PathPointType as byte * fix infinite recursion * define helper methods as private * fix IsVisible and IsOutlineVisible helper methods * fix GetBound method * fix PathType property and CreatePath helper method * minor fix * fix AddBezier helper method * fix AddLine helper method * fix AddPie helper method * fix AddCurve and AddEllipse helper methods visibility * fix AddCurve helper method * minor indentation fix * implement Flatten method * simplify Flatten method * improve performance in Matrix.TransformPoints method * fix GraphicsPath.PathTypes property * add GraphicsPath.ToSvg extra method * fix GtaphicsPath.PathTypes property * fix GraphicsPath.Flatten method * add using in GraphicsPath.Reverse method * remove comment * minor change * add unit test for GraphicsPath class * minor changes in test cases for Region and GraphicsPath * change definition for Pen properties: DashCap, DashOffset, DashPattern, StartCap, and EndCap * init proper values in Pen class * minor improvement on exception message for Pen.Aligment property * fix Pen.Brush property behaviour * fix Pen.Clone method * add Pen unit test * minor change in PenUnitTest class * fix clone method unit test for several classes * add SolidBrushUnitTest * minor change * update TestureBrush for supporing RectangleF and Image classes, and dynamically update shader * add HatchBrush constructor summary and missing constructor (without background color) * change CreateShader by UpdateShader in HatchBrush class * add TextureBrushUnitTest * change indentation by tabs in Pen class * fix TextureBrush.Clone method * minor change in SolidBrushUnitTest * add unit test for Clone method in TextureBrushUnitTest * add HatchBrushUnitTest * minor change * add validation to InterpolationColors in LinearGradientBrush * fix LinearGradientBrush constructor * check null in InterpolationColors of LinearGradientBrush * fix UpdateShader of LinearGradientBrush based on factor and color blends * implement SetSigmaBellShape and SetBlendTriangularShape methdos of LinearGradientBrush * fix SigmaBellBlend helper in LinearGradientBrush * fix LinearGradientBrush class * add LinearGradientBrush unit test * minor fix in namespace for Utils class * improve SolidBrush unit test * add Bitmap.Clone overload with RectangleF * fix TextureBrush constructors singnatures * fix UpdateShader method from TextureBrush, including matrix in the code * fix TextureBrushUnitTest * minor change in summary for HatchBrush constructor * simplify HatchBrush.UpdateShader method and improve readability * update hit threshold for image comparison * enhance HashBrush test cases * update color-green.png expected with #0F0 instead of #008000 * fix LinearGradientBrush.UpdateShader method * simplify test cases comparing images and rename expected images with exactly the same name as the value they are testing * add matrix comparison in LinearGradientBrush unit test for Clone method * fix GraphicsPath.Clone method * fix GraphicsPath.GetBounds method * fix GraphicsPath.CreatePath method when bezier curve has odd points count * fix PathGradientBrush.InterpolationColors property set * fix GraphicsPath.Clone method * generalize Brush's SetBlendTriangularShape and SetSigmaBellShape methods * fix PathGradientBrush.Clone method * fix PathGradientBrush.InterpolationColors property * fix PathGradientBrush.UpdateShader method and constructor * fix LinearGradientBrush.UpdateShader method * add missing PathGradientBrush constructors * rename m_interpolation by m_color in PathGradientBrush class * make m_color and m_surround independent colors and define center by using MidX/MidY properties in PathGradientBrush * add GraphicsPath.FromSvg extra method * add .DS_Store to gitignore * fix GraphicsPath.AddString method when StringFormatFlags.NoClip is not set and layout parameter is an infinite rectangle * fix initial center calculation in PathGradientBrush class * implement circle vs ellipsis in PathGradientBrush class and fix radius calculation * fix PathGradientBrush.CreatePath method to create a closed shape * fix PathGradientBrush.UpdateShader method to consider ellipse gradient * close open figures in GraphicsPath class * minor change in GraphicsPathUnitTest for simplicity * minor typo fix in comment * adjust image similarity threshold in unit-tests because of antialiasing * compare images by pixel color euclidean distance, add bounding rectangle and center poiint calculation methods based on set of points * fix PathGradientBrush.UpdateShader without transforming center/focus properties * fix PathGradientBrush.UpdateShader translation based on center point * fix infinite recursion in Region.IsVisible method * redefine Ceiling, Trunkcate and Round from PointF struct in Point struct * fix Region.IsVisible based on Point.Truncate method * add Vector2 related methods to PointF struct * update unit tests for Point and PointF after migrating Ceiling, Round and Truncate methods from PointF struct to Point struct * add unit tests for Vector2 related methods in PointF struct * fix possible null Matrix parameter value in GraphicsPath.Flatten method * fix Clone method in LinearGradientBrush and PathGradientBrush classes * minor change * minor identation change in Region class * fix PathGradientBrush.CenterColor default depending if SurroundColors was set or not, and include some minor improvements * add constraint check in PathGradientBrush.SurroundColors property set * add support for custom shape gradient in PathGradientBrush extending its functionality beyond just radial gradients * rename m_blend property by m_factor in LinearGradientBrush and PathGradientBrush classes * add Color.Blend method for mixing two colors * fix GraphicsPath.IsVisible method due to behavior differences with Skia * simplify test utils module's methods: GetCenterPoint and GetBoundingRectangle * change offset of GraphicsPath.IsVisible method because skia is not considering the path border in the Contains method * minor fix in ComputeColor.PathGradientBrush when calculate distances between the target point and the edge of the path shape * add PathGradientBrush unit tests * update README with new components * remove unnecesary whitespaces in PathGradientBrush class * remove ApplyFactor method and fix how colors are calculated based on blend factor and interpolation * fix PathGradientBrush.UpdateShader when just using blend factors * add basic test case for PathGradientBrush.Transform property * define PathGradientBrush helper methods as private: Intersect and Triangulated * apply clamp in PathGradientBrush helper method: Project * add support for PathGradientBrush.FocusScale property * add comments on PathGradientBrush helper methods * fix PathGradientBrush when ScaleFactor is zero (default value) and improve performance by reducing calculations * add FocusScales test-cases for PathGradientBrush * minor change for improving readability * implement Graphics' Restore and Save methods, add GraphicsState class * remove unused SKCanvas reference from GraphicsState class * fix several indentation issues with spaces * fix Graphics.Transform property * fix Graphics.Save method to use SKCanvas.Save method instead of SKCanvas.SaveLayer method * fix Graphics.DrawCurve, Graphics.DrawClosedCurve and Graphics.FillClosedCurve in order to use the same GetCurvePath helper method * fix mutually infinite recursion in Graphics.IsVisible overloads * fix Graphics.DrawImage method over rectangles * fix Graphics.DrawImage method over custom shape * add support for DigitSubstitutionMethod and DigitSubstitutionLanguage in StringFormat class * fix Graphics' clip methods * fix Graphics.VisibleClipBounds definition (getter only) * minor change in method description * fix Grapchis.RotateTransform method angle * fix Graphics.MultiplyTransform method * uniformize the way of getting DPI value in Graphics and update Font to use that implementation in order to improve maintainability * minor changes * fix GraphicsPath.AddBeziers method * change GraphicsPath constructor visibility to internal * improve Graphics.DrawImage for maintainability * fix missin gusing in Graphics.MeasureStringInternal method * fix GraphicsPath.AddLines method * implement Graphics.TransformPoints method with CoordinateSpace parameters * add message to exceptions that not have one * fix Graphics.GetNearestColor method * fix Graphics.BeginContainer method * add Graphics.GetContextInfo missing method * fix typo in RegionUnitTest * change Region constructor visiblity and fix MakeInfinite method * fix Graphics.Clip property * change every Graphics draw/fill method to use path for implementing IsVisible method * fix GraphicsPath.IsVisible method that must check if point/rect is contained in the shape defined in the canvas * fix Graphics' BeginContainer that must reset the class state until to be restored while Save applies an accumulative state * add support for Graphics.CompositingMode * fix HatchBrush shader rendering * add support for Graphics.RenderingOrigin property * fix CompositingMode enum name * add support for Graphics.InterpolationMode property * fix StringFormat.GenericTypographic property default flags * fix StringFormat border case when applying wrapping and avoid subpixel render * fix Graphics.MeasureCharacterRanges method in order to consider MeasurableRanges in StingFormat * fix Graphics.DrawString overloads calls * fix Graphics.MeasureString overload calls * add support for Graphics.SmoothingMode property * fix GraphicsPath.AddString overload calls * fix and improve readability of AddString internal method that applies StringFormat to get the text path * fix Graphics.MeasureStringInternal method that's not considering total sizes when measuring the string * fix Gracphis.IsVisible disposable reference by making a copy * consider font Unit in Graphics' DrawString, MeasureCharacterRanges and MeasureStringInternal methods * fix lineHeight calculation in GraphicsPath.AddString method * add ColorTranslator class * fix Color class for known colors by setting the name and index * minor fix in description of ColorTranslator class * add ConvertFromString method in ColorTranslator class * add ColorConverter class * update ColorTranslator unit test after fixing known colors for Color class * add summary for ColorConverter class and update README * fix AddString typeface disposed variable * minor change * add note for Graphics.DrawString method that uses path drawing instead of skia's DrawText method; as a result, the output may experience a slight offset in positioning and measuring * add Graphics.GetStringBounds private method to be used by MeasureCharacterRanges and MeasureStringInternal public methods * add ceiling in GraphicsPath.AddString method in order to skia can render the underline when the rectangle is defined by floating values * minor change in StringFormat.ApplyWrapping and StringFormat.ApplyTrimming method when deciding split text in a new line * add CompareImage to Utils class for comparing images * add notes in Graphics class for PixelOffsetMode, TextContrast and TextRenderingHint properties * add unit tests for Graphics class * add SolidBrush to README * add StringFormat to README * adjust thresholds for DrawString, MeasureString and MeasureCharacterRanges of Graphics class * remove ceiling defining the underline when adding string to GraphicsPath * Change properties A, R, G, and B from int to the expected byte type for consistency --------- Co-authored-by: damiansalvia <[email protected]> Co-authored-by: Damian Salvia Varela <[email protected]> Co-authored-by: Claudia Murialdo <[email protected]>
- Loading branch information