Skip to content

Text: add Offset support#3506

Closed
jamaa wants to merge 1 commit intoScottPlot:mainfrom
bluemodel:text-pixeloffset
Closed

Text: add Offset support#3506
jamaa wants to merge 1 commit intoScottPlot:mainfrom
bluemodel:text-pixeloffset

Conversation

@jamaa
Copy link
Contributor

@jamaa jamaa commented Mar 18, 2024

When rendering a Text plottable, add its PixelOffset to the rendering location.

ScottPlot.Plot myPlot = new();
ScottPlot.Plottables.Text myText = myPlot.Add.Text("test", 0, 0);
myText.Label.Alignment = Alignment.LowerLeft;
myText.PixelOffset = new PixelSize(5, -5); // offset text 5 pixels right and up
myPlot.SavePng("Text with offset.png", 600, 400);

grafik

@swharden swharden changed the title add PixelOffset to Text rendering location Text: add Offset support Mar 19, 2024
@swharden
Copy link
Member

Thanks for this fix @jamaa!

I didn't have access to edit the code in this branch (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so I created a new one (#3512) and merged this in over there 🚀

@swharden swharden closed this Mar 19, 2024
@jamaa jamaa deleted the text-pixeloffset branch March 20, 2024 08:47
@jamaa
Copy link
Contributor Author

jamaa commented Mar 20, 2024

Thanks for the heads-up about allowing commits into forked branches, I didn't know about that feature and will use it in future PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants