oxyplot / oxyplot-avalonia

A cross-platform plotting library for .NET. This package targets Avalonia apps.
https://oxyplot.github.io/
MIT License
274 stars 47 forks source link

Fix Rotated Text (#11) #12

Closed VisualMelon closed 4 years ago

VisualMelon commented 4 years ago

Fixes #11

Sets the RenderTransformOrigin of TextBlocks to be their Top-Left corner. TextBlocks were being rotated around their centre, rather than the top-left corner as is typical of e.g. the WinForms renderer from which the code appears to be derived, resulting in incorrect results when the rotation was non-zero.

worldbeater commented 4 years ago

Btw do we have a sample demonstrating the presence of the issue? If no, then would it be too much to ask you to add a repro to the AvaloniaExamples project? :pray:

VisualMelon commented 4 years ago

@worldbeater sorry for the sparse report. Below are 'before' and 'after' figures showing the TextAnnotation/TextAnnotation example in the example browser (pulled in #10).

Before TextRotBefore

After TextRotAfter