Skip to content

Commit

Permalink
Merge pull request #208 from eaton-lab/text-rotate-extents
Browse files Browse the repository at this point in the history
use matrix mult on text angle transform arrays
  • Loading branch information
tshead2 committed Oct 13, 2022
2 parents 42508c4 + a7809cd commit f9deeba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions toyplot/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def extents(text, angle, style):

for index, theta in enumerate(angle):
transformation = toyplot.transform.rotation(theta)
corner1[index] = numpy.diag(corner1[index] * transformation)
corner2[index] = numpy.diag(corner2[index] * transformation)
corner3[index] = numpy.diag(corner3[index] * transformation)
corner4[index] = numpy.diag(corner4[index] * transformation)
corner1[index] = numpy.matmul(corner1[index], transformation)
corner2[index] = numpy.matmul(corner2[index], transformation)
corner3[index] = numpy.matmul(corner3[index], transformation)
corner4[index] = numpy.matmul(corner4[index], transformation)

left = numpy.minimum(corner1.T[0], numpy.minimum(
corner2.T[0], numpy.minimum(corner3.T[0], corner4.T[0])))
Expand Down

0 comments on commit f9deeba

Please sign in to comment.