mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
Move drawing code of EditorView from kPaintMessage to onPaint()
This commit is contained in:
parent
a0e403b6a6
commit
b41841ddd2
@ -28,7 +28,7 @@
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/skin/skin_theme.h"
|
||||
#include "app/ui_context.h"
|
||||
#include "ui/message.h"
|
||||
#include "ui/paint_event.h"
|
||||
#include "ui/resize_event.h"
|
||||
|
||||
#include <allegro.h>
|
||||
@ -59,12 +59,9 @@ EditorView::~EditorView()
|
||||
UIContext::instance()->settings()->removeObserver(this);
|
||||
}
|
||||
|
||||
bool EditorView::onProcessMessage(Message* msg)
|
||||
void EditorView::onPaint(PaintEvent& ev)
|
||||
{
|
||||
switch (msg->type()) {
|
||||
|
||||
case kPaintMessage:
|
||||
{
|
||||
Graphics* g = ev.getGraphics();
|
||||
Widget* viewport = getViewport();
|
||||
Widget* child = UI_FIRST_WIDGET(viewport->getChildren());
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
|
||||
@ -84,16 +81,10 @@ bool EditorView::onProcessMessage(Message* msg)
|
||||
|
||||
}
|
||||
|
||||
theme->draw_bounds_nw(ji_screen, getBounds(),
|
||||
theme->draw_bounds_nw(g, getClientBounds(),
|
||||
selected ? PART_EDITOR_SELECTED_NW:
|
||||
PART_EDITOR_NORMAL_NW,
|
||||
ColorNone);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return View::onProcessMessage(msg);
|
||||
}
|
||||
|
||||
void EditorView::onResize(ResizeEvent& ev)
|
||||
|
@ -34,7 +34,7 @@ namespace app {
|
||||
~EditorView();
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(ui::Message* msg) OVERRIDE;
|
||||
void onPaint(ui::PaintEvent& ev) OVERRIDE;
|
||||
void onResize(ui::ResizeEvent& ev) OVERRIDE;
|
||||
|
||||
// GlobalSettingsObserver impl
|
||||
|
Loading…
Reference in New Issue
Block a user