Name
pmatrix:TransformPixelRectangle -- transform pixel rectangle
Synopsis
rc = pmatrix:TransformPixelRectangle(rect)
Function
First transforms the rect using the matrix, then calculates the bounding box of the transformed rectangle. The rect parameter must be a table that has the x, y, width, and height fields initialized. The return table will also have these fields initialized.

This function is useful for example when you want to draw a rotated Pango layout to an image buffer, and want to know how large the image should be and how much you should shift the layout when rendering.

For better accuracy, you should use pmatrix:TransformRectangle() on original rectangle in Pango units and convert to pixels afterward using pango.ExtentsToPixels()'s first argument.

Inputs
rect
bounding box in device units
Results
rc
transformed rectangle

Show TOC