VgaGames 3 - Miscellaneous man-pages

[.. upper level ..]

VG3_correct_imageposition()

Correct the x-/y-position of an image, which size was changed, to keep the center unchanged.
SYNTAX
struct vg3_rect VG3_correct_imageposition(struct vg3_rect *orect, int width, int height)

FUNCTION PARAMETERS
orect Actual rectangle of the position of the image
width New width of the image
height New height of the image

RETURN VALUE
Returns the new rectangle of the position of the image.

DESCRIPTION
When an image is drawn onto the window, the target coordinate will be used with the center of the image. Changes the image its size, its rectangle position must be corrected, elements w and h get the new size, elements x and y get the new position to calculate the same coordinate of the image on the destination. With this function a fully corrected rectangle will be returned.