Implemented skewing. Will do the test now.
This commit is contained in:
parent
46e3fee40d
commit
de3ccecd5b
|
@ -333,9 +333,9 @@ void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
|
|||
c2m(&c, m);
|
||||
}
|
||||
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double amount, double yamount)
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
complain("TODO");
|
||||
fallbackSkew(m, x, y, xamount, yamount);
|
||||
}
|
||||
|
||||
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
|
||||
|
|
18
matrix.c
18
matrix.c
|
@ -12,7 +12,23 @@ void setIdentity(uiDrawMatrix *m)
|
|||
m->M32 = 0;
|
||||
}
|
||||
|
||||
// TODO skew
|
||||
// TODO don't default to fallback functions within the fallback functions
|
||||
|
||||
// technique from "Programming with Quartz: 2D and PDF Graphics in Mac OS X"
|
||||
// TODO if Windows 7 is ever dropped change this so we can pass in D2D1Tan()
|
||||
void fallbackSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
uiDrawMatrix t, n;
|
||||
|
||||
setIdentity(&t);
|
||||
fallbackTranslate(&t, x, y);
|
||||
setIdentity(&n);
|
||||
n.M12 = tan(xamount);
|
||||
n.M21 = tan(yamount);
|
||||
fallbackMultiply(&n, &t);
|
||||
// TODO undo the translation?
|
||||
fallbackMultiply(&m, &n);
|
||||
}
|
||||
|
||||
// see windows/draw.c for more information
|
||||
// TODO we don't need to do this if we can bypass the multiplication somehow
|
||||
|
|
1
uipriv.h
1
uipriv.h
|
@ -62,6 +62,7 @@ extern int fromScancode(uintptr_t, uiAreaKeyEvent *);
|
|||
|
||||
// matrix.c
|
||||
extern void setIdentity(uiDrawMatrix *);
|
||||
extern void fallbackSkew(uiDrawMatrix *, double, double, double, double);
|
||||
extern void fallbackTranslate(uiDrawMatrix *, double, double);
|
||||
extern void scaleCenter(double, double, double *, double *);
|
||||
extern void fallbackScale(uiDrawMatrix *, double, double, double, double);
|
||||
|
|
|
@ -362,9 +362,9 @@ void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)
|
|||
c2m(&c, m);
|
||||
}
|
||||
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double amount, double yamount)
|
||||
void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)
|
||||
{
|
||||
complain("TODO");
|
||||
fallbackSkew(m, x, y, xamount, yamount);
|
||||
}
|
||||
|
||||
void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)
|
||||
|
|
Loading…
Reference in New Issue