fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.34k stars 352 forks source link

text drawing broken since introduction of text scaling transform #159

Open marco-m opened 2 years ago

marco-m commented 2 years ago

Hello @fogleman, thanks for gg!

If I run examples/quadratic.go I get

image

The image is created correctly at commit 15eec45bd9 (when examples/quadratic.go was introduced):

image

I then ran a git bisect and got:

2c35caba582611ac0393cc589134cc293a2a0782 is the first bad commit
commit 2c35caba582611ac0393cc589134cc293a2a0782
Author: wsw <wsw0108@gmail.com>
Date:   Sun Jan 8 16:23:33 2017 +0800

    apply current matrix when draw text

 context.go               | 29 +++++++++++++++++++++++++----
 examples/rotated-text.go | 30 ++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 4 deletions(-)
 create mode 100644 examples/rotated-text.go

For reference, it is PR #16.

@fogleman I was also thinking: if the various out.png of the examples directory normally do not change, then we could add a CI step that runs all the examples and compares the corresponding out.png (purely as a binary comparison), what is normally called golden files, and fail the CI if any file differs. I would be then up to the committer to decide if there is a real reason for the change, and at this point the PR would contain also the updated out.png.

marco-m commented 2 years ago

Hello @wsw0108, any ideas how what could have caused this?