diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-09 10:33:38 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-09 10:33:38 -0400 |
| commit | 6c1bf7aabd859c27f26898ead8572dd00f419d57 (patch) | |
| tree | 25e012396edc1c09c4252ac12c1e4d5a5a47d51a /redo/area_windows.go | |
| parent | b4a97e871a5c6c390927f5bac9b84b0fe6b40c20 (diff) | |
Big change: with the current event model, it's safe to call Area.RepaintAll() (and the future Area.Repaint()) from within AreaHandler.Key() and AreaHandler.Mouse(); get rid of the bool returns from each. The future Area.Repaint() is important; the bool returns repainted the whole Area, which may not be optimal.
Diffstat (limited to 'redo/area_windows.go')
| -rw-r--r-- | redo/area_windows.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/redo/area_windows.go b/redo/area_windows.go index d96a21c..0137a3f 100644 --- a/redo/area_windows.go +++ b/redo/area_windows.go @@ -150,10 +150,7 @@ func finishAreaMouseEvent(data unsafe.Pointer, cbutton C.DWORD, up C.BOOL, wPara if button != 5 && (wParam & C.MK_XBUTTON2) != 0 { me.Held = append(me.Held, 5) } - repaint := a.handler.Mouse(me) - if repaint { - a.RepaintAll() - } + a.handler.Mouse(me) } //export areaKeyEvent @@ -188,11 +185,7 @@ func areaKeyEvent(data unsafe.Pointer, up C.BOOL, wParam C.WPARAM, lParam C.LPAR return } ke.Up = up != C.FALSE - // TODO repaint may no longer be needed - repaint := a.handler.Key(ke) - if repaint { - a.RepaintAll() - } + a.handler.Key(ke) } // all mappings come from GLFW - https://github.com/glfw/glfw/blob/master/src/win32_window.c#L152 |
