Fix uninitialized memory access in toolbar.
parent
8d07a6b4f4
commit
9d1601eea9
|
@ -390,6 +390,7 @@ void GraphicsWindow::Init() {
|
|||
|
||||
showSnapGrid = false;
|
||||
context.active = false;
|
||||
toolbarHovered = Command::NONE;
|
||||
|
||||
if(!window) {
|
||||
window = Platform::CreateWindow();
|
||||
|
|
|
@ -154,6 +154,9 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my,
|
|||
|
||||
bool withinToolbar =
|
||||
(mx >= aleft && mx <= aright && my <= atop && my >= abot);
|
||||
|
||||
// Initialize/clear menuHit.
|
||||
if(menuHit) *menuHit = Command::NONE;
|
||||
|
||||
if(!canvas && !withinToolbar) {
|
||||
// This gets called every MouseMove event, so return quickly.
|
||||
|
@ -224,9 +227,5 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my,
|
|||
}
|
||||
}
|
||||
|
||||
if(!withinToolbar) {
|
||||
if(menuHit) *menuHit = Command::NONE;
|
||||
}
|
||||
|
||||
return withinToolbar;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue