Switched coordinates to floating-point drawing space and implemented such on GTK+.
This commit is contained in:
parent
a504bcee40
commit
6849b01f73
14
ui.h
14
ui.h
|
@ -275,10 +275,10 @@ _UI_EXTERN uiArea *uiNewArea(uiAreaHandler *ah);
|
||||||
struct uiAreaDrawParams {
|
struct uiAreaDrawParams {
|
||||||
uiDrawContext *Context;
|
uiDrawContext *Context;
|
||||||
|
|
||||||
// TODO this and the mouse event ones should probably be in points and not pixels
|
double ClientWidth;
|
||||||
intmax_t ClientWidth;
|
double ClientHeight;
|
||||||
intmax_t ClientHeight;
|
|
||||||
|
|
||||||
|
// TODO keep this?
|
||||||
intmax_t ClipX;
|
intmax_t ClipX;
|
||||||
intmax_t ClipY;
|
intmax_t ClipY;
|
||||||
intmax_t ClipWidth;
|
intmax_t ClipWidth;
|
||||||
|
@ -439,11 +439,11 @@ enum uiModifiers {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct uiAreaMouseEvent {
|
struct uiAreaMouseEvent {
|
||||||
intmax_t X;
|
double X;
|
||||||
intmax_t Y;
|
double Y;
|
||||||
|
|
||||||
intmax_t ClientWidth;
|
double ClientWidth;
|
||||||
intmax_t ClientHeight;
|
double ClientHeight;
|
||||||
intmax_t HScrollPos;
|
intmax_t HScrollPos;
|
||||||
intmax_t VScrollPos;
|
intmax_t VScrollPos;
|
||||||
|
|
||||||
|
|
|
@ -158,6 +158,9 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
|
||||||
|
|
||||||
dp.Context = newContext(cr);
|
dp.Context = newContext(cr);
|
||||||
|
|
||||||
|
// these are already in drawing space coordinates
|
||||||
|
// the size of drawing space has the same value as the widget allocation
|
||||||
|
// thanks to tristan in irc.gimp.net/#gtk+
|
||||||
dp.ClientWidth = ap->clientWidth;
|
dp.ClientWidth = ap->clientWidth;
|
||||||
dp.ClientHeight = ap->clientHeight;
|
dp.ClientHeight = ap->clientHeight;
|
||||||
|
|
||||||
|
@ -236,6 +239,9 @@ static void finishMouseEvent(struct areaPrivate *ap, uiAreaMouseEvent *me, guint
|
||||||
// don't check GDK_BUTTON4_MASK or GDK_BUTTON5_MASK because those are for the scrolling buttons mentioned above
|
// don't check GDK_BUTTON4_MASK or GDK_BUTTON5_MASK because those are for the scrolling buttons mentioned above
|
||||||
// GDK expressly does not support any more buttons in the GdkModifierType; see https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkdevice-xi2.c#n763 (thanks mclasen in irc.gimp.net/#gtk+)
|
// GDK expressly does not support any more buttons in the GdkModifierType; see https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkdevice-xi2.c#n763 (thanks mclasen in irc.gimp.net/#gtk+)
|
||||||
|
|
||||||
|
// these are already in drawing space coordinates
|
||||||
|
// the size of drawing space has the same value as the widget allocation
|
||||||
|
// thanks to tristan in irc.gimp.net/#gtk+
|
||||||
me->X = x;
|
me->X = x;
|
||||||
me->Y = y;
|
me->Y = y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue