Added uipriv prefixes to the matrix functions.
This commit is contained in:
parent
24a4b0997c
commit
01d6422664
|
@ -1,8 +1,3 @@
|
|||
|
||||
// matrix.c
|
||||
extern void fallbackSkew(uiDrawMatrix *, double, double, double, double);
|
||||
extern void scaleCenter(double, double, double *, double *);
|
||||
extern void fallbackTransformSize(uiDrawMatrix *, double *, double *);
|
||||
|
||||
// OS-specific text.* files
|
||||
extern int uiprivStricmp(const char *a, const char *b);
|
||||
|
|
|
@ -18,7 +18,7 @@ void uiDrawMatrixSetIdentity(uiDrawMatrix *m)
|
|||
|
||||
// see https://msdn.microsoft.com/en-us/library/windows/desktop/ff684171%28v=vs.85%29.aspx#skew_transform
|
||||
// TODO see if there's a way we can avoid the multiplication
|
||||
void fallbackSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
void uiprivFallbackSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
uiDrawMatrix n;
|
||||
|
||||
|
@ -31,7 +31,7 @@ void fallbackSkew(uiDrawMatrix *m, double x, double y, double xamount, double ya
|
|||
uiDrawMatrixMultiply(m, &n);
|
||||
}
|
||||
|
||||
void scaleCenter(double xCenter, double yCenter, double *x, double *y)
|
||||
void uiprivScaleCenter(double xCenter, double yCenter, double *x, double *y)
|
||||
{
|
||||
*x = xCenter - (*x * xCenter);
|
||||
*y = yCenter - (*y * yCenter);
|
||||
|
@ -39,7 +39,7 @@ void scaleCenter(double xCenter, double yCenter, double *x, double *y)
|
|||
|
||||
// the basic algorithm is from cairo
|
||||
// but it's the same algorithm as the transform point, just without M31 and M32 taken into account, so let's just do that instead
|
||||
void fallbackTransformSize(uiDrawMatrix *m, double *x, double *y)
|
||||
void uiprivFallbackTransformSize(uiDrawMatrix *m, double *x, double *y)
|
||||
{
|
||||
uiDrawMatrix m2;
|
||||
|
||||
|
|
|
@ -54,9 +54,9 @@ extern void uiprivClickCounterReset(uiprivClickCounter *);
|
|||
extern int uiprivFromScancode(uintptr_t, uiAreaKeyEvent *);
|
||||
|
||||
// matrix.c
|
||||
extern void fallbackSkew(uiDrawMatrix *, double, double, double, double);
|
||||
extern void scaleCenter(double, double, double *, double *);
|
||||
extern void fallbackTransformSize(uiDrawMatrix *, double *, double *);
|
||||
extern void uiprivFallbackSkew(uiDrawMatrix *, double, double, double, double);
|
||||
extern void uiprivScaleCenter(double, double, double *, double *);
|
||||
extern void uiprivFallbackTransformSize(uiDrawMatrix *, double *, double *);
|
||||
|
||||
// OS-specific text.* files
|
||||
extern int uiprivStricmp(const char *a, const char *b);
|
||||
|
|
|
@ -334,7 +334,7 @@ void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x
|
|||
m2c(m, &c);
|
||||
xt = x;
|
||||
yt = y;
|
||||
scaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
uiprivScaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
c = CGAffineTransformTranslate(c, xt, yt);
|
||||
c = CGAffineTransformScale(c, x, y);
|
||||
c = CGAffineTransformTranslate(c, -xt, -yt);
|
||||
|
@ -354,7 +354,7 @@ void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
|
|||
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
fallbackSkew(m, x, y, xamount, yamount);
|
||||
uiprivFallbackSkew(m, x, y, xamount, yamount);
|
||||
}
|
||||
|
||||
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
|
||||
|
|
|
@ -39,7 +39,7 @@ void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x
|
|||
m2c(m, &c);
|
||||
xt = x;
|
||||
yt = y;
|
||||
scaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
uiprivScaleCenter(xCenter, yCenter, &xt, &yt);
|
||||
cairo_matrix_translate(&c, xt, yt);
|
||||
cairo_matrix_scale(&c, x, y);
|
||||
cairo_matrix_translate(&c, -xt, -yt);
|
||||
|
@ -59,7 +59,7 @@ void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
|
|||
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
fallbackSkew(m, x, y, xamount, yamount);
|
||||
uiprivFallbackSkew(m, x, y, xamount, yamount);
|
||||
}
|
||||
|
||||
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
|
||||
|
|
|
@ -113,5 +113,5 @@ void uiDrawMatrixTransformPoint(uiDrawMatrix *m, double *x, double *y)
|
|||
|
||||
void uiDrawMatrixTransformSize(uiDrawMatrix *m, double *x, double *y)
|
||||
{
|
||||
fallbackTransformSize(m, x, y);
|
||||
uiprivFallbackTransformSize(m, x, y);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue