Answered matrix scaling stuff. https://www.willamette.edu/~gorr/classes/GeneralGraphics/Transforms/transforms2d.htm#Combining
This commit is contained in:
parent
b66be0bf2d
commit
a99a81f584
|
@ -23,6 +23,7 @@ This README is being written.<br>
|
|||
* uiDateTimePicker on GTK+ works properly on RTL layouts and no longer disappears off the bottom of the screen if not enough room is available. It will also no longer be marked for localization of the time format (what the separator should be and whether to use 24-hour time), as that information is not provided by the locale system. :(
|
||||
* Added `uiUserBugCannotSetParentOnToplevel()`, which should be used by implementations of toplevel controls in their `SetParent()` implementations. This will also be the beginning of consolidating common user bug messages into a single place, though this will be one of the only few exported user bug functions.
|
||||
* uiSpinbox and uiSlider now merely swap their min and max if min ≥ max. They will no longer panic and do nothing, respectively.
|
||||
* Matrix scaling will no longer leave the matrix in an invalid state on OS X and GTK+.
|
||||
|
||||
## Runtime Requirements
|
||||
|
||||
|
|
|
@ -332,13 +332,12 @@ void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x
|
|||
double xt, yt;
|
||||
|
||||
m2c(m, &c);
|
||||
// TODO explain why the translation must come first
|
||||
xt = x;
|
||||
yt = y;
|
||||
scaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
c = CGAffineTransformTranslate(c, xt, yt);
|
||||
c = CGAffineTransformScale(c, x, y);
|
||||
// TODO undo the translation?
|
||||
c = CGAffineTransformTranslate(c, -xt, -yt);
|
||||
c2m(&c, m);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,13 +37,12 @@ void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x
|
|||
double xt, yt;
|
||||
|
||||
m2c(m, &c);
|
||||
// TODO explain why the translation must come first
|
||||
xt = x;
|
||||
yt = y;
|
||||
scaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
cairo_matrix_translate(&c, xt, yt);
|
||||
cairo_matrix_scale(&c, x, y);
|
||||
// TODO undo the translation?
|
||||
cairo_matrix_translate(&c, -xt, -yt);
|
||||
c2m(&c, m);
|
||||
}
|
||||
|
||||
|
@ -54,7 +53,6 @@ void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
|
|||
m2c(m, &c);
|
||||
cairo_matrix_translate(&c, x, y);
|
||||
cairo_matrix_rotate(&c, amount);
|
||||
// TODO undo the translation? also cocoa backend
|
||||
cairo_matrix_translate(&c, -x, -y);
|
||||
c2m(&c, m);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue