Skip to content

Background images cannot be rotated or sheared #3874

@ctrlcctrlv

Description

@ctrlcctrlv

Images cannot be rotated, skewed, or flipped, only scaled and moved.

void BackgroundImageTransform(SplineChar *sc, ImageList *img,real transform[6]) {
if ( transform[1]==0 && transform[2]==0 && transform[0]>0 && transform[3]>0 ) {
img->xoff = transform[0]*img->xoff + transform[4];
img->yoff = transform[3]*img->yoff + transform[5];
if (( img->xscale *= transform[0])<0 ) img->xscale = -img->xscale;
if (( img->yscale *= transform[3])<0 ) img->yscale = -img->yscale;
img->bb.minx = img->xoff; img->bb.maxy = img->yoff;
img->bb.maxx = img->xoff + GImageGetWidth(img->image)*img->xscale;
img->bb.miny = img->yoff - GImageGetHeight(img->image)*img->yscale;
} else {
/* Don't support rotating, flipping or skewing images */
;
}
SCOutOfDateBackground(sc);
}

/* Don't support rotating, flipping or skewing images */;

I want to fix this, but the code is quite confusing. I'm opening this issue so I remember it. Please feel free to comment if you can help, I've looked at the code for a little while and don't yet fully understand why this limitation exists.

This issue supersedes #3396.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions