mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-18 11:42:47 +00:00
Merge branch 'dev' of git@github.com:aseprite/aseprite.git into dev
This commit is contained in:
commit
a21febf6e8
@ -64,6 +64,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onScrollChanged(Editor* editor) OVERRIDE {
|
void onScrollChanged(Editor* editor) OVERRIDE {
|
||||||
|
if (current_editor == this)
|
||||||
App::instance()->getMainWindow()->getMiniEditor()->updateUsingEditor(this);
|
App::instance()->getMainWindow()->getMiniEditor()->updateUsingEditor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,9 +324,6 @@ void Editor::setEditorScroll(int x, int y, int use_refresh_region)
|
|||||||
|
|
||||||
if (thick)
|
if (thick)
|
||||||
editor_draw_cursor(m_cursor_screen_x, m_cursor_screen_y);
|
editor_draw_cursor(m_cursor_screen_x, m_cursor_screen_y);
|
||||||
|
|
||||||
// Notify observers
|
|
||||||
m_observers.notifyScrollChanged(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::updateEditor()
|
void Editor::updateEditor()
|
||||||
@ -869,9 +866,6 @@ void Editor::centerInSpritePoint(int x, int y)
|
|||||||
|
|
||||||
showDrawingCursor();
|
showDrawingCursor();
|
||||||
invalidate();
|
invalidate();
|
||||||
|
|
||||||
// Notify observers
|
|
||||||
m_observers.notifyScrollChanged(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::updateStatusBar()
|
void Editor::updateStatusBar()
|
||||||
@ -1164,9 +1158,6 @@ void Editor::setZoomAndCenterInMouse(int zoom, int mouse_x, int mouse_y, ZoomBeh
|
|||||||
|
|
||||||
updateEditor();
|
updateEditor();
|
||||||
setEditorScroll(x, y, use_refresh_region);
|
setEditorScroll(x, y, use_refresh_region);
|
||||||
|
|
||||||
// Notify observers
|
|
||||||
m_observers.notifyScrollChanged(this);
|
|
||||||
}
|
}
|
||||||
showDrawingCursor();
|
showDrawingCursor();
|
||||||
}
|
}
|
||||||
@ -1225,6 +1216,11 @@ void Editor::pasteImage(const Image* image, int x, int y)
|
|||||||
setState(EditorStatePtr(new MovingPixelsState(this, NULL, pixelsMovement, NoHandle)));
|
setState(EditorStatePtr(new MovingPixelsState(this, NULL, pixelsMovement, NoHandle)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Editor::notifyScrollChanged()
|
||||||
|
{
|
||||||
|
m_observers.notifyScrollChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
void Editor::onSetTiledMode(filters::TiledMode mode)
|
void Editor::onSetTiledMode(filters::TiledMode mode)
|
||||||
{
|
{
|
||||||
invalidate();
|
invalidate();
|
||||||
|
@ -169,6 +169,10 @@ namespace app {
|
|||||||
|
|
||||||
void pasteImage(const Image* image, int x, int y);
|
void pasteImage(const Image* image, int x, int y);
|
||||||
|
|
||||||
|
// Used by EditorView to notify changes in the view's scroll
|
||||||
|
// position.
|
||||||
|
void notifyScrollChanged();
|
||||||
|
|
||||||
// in cursor.cpp
|
// in cursor.cpp
|
||||||
|
|
||||||
static int get_raw_cursor_color();
|
static int get_raw_cursor_color();
|
||||||
|
@ -63,8 +63,7 @@ EditorView::~EditorView()
|
|||||||
void EditorView::onPaint(PaintEvent& ev)
|
void EditorView::onPaint(PaintEvent& ev)
|
||||||
{
|
{
|
||||||
Graphics* g = ev.getGraphics();
|
Graphics* g = ev.getGraphics();
|
||||||
Widget* viewport = getViewport();
|
Widget* child = attachedWidget();
|
||||||
Widget* child = UI_FIRST_WIDGET(viewport->getChildren());
|
|
||||||
SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
|
SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
|
||||||
bool selected = false;
|
bool selected = false;
|
||||||
|
|
||||||
@ -96,6 +95,16 @@ void EditorView::onResize(ResizeEvent& ev)
|
|||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorView::onScrollChange()
|
||||||
|
{
|
||||||
|
View::onScrollChange();
|
||||||
|
|
||||||
|
Editor* editor = static_cast<Editor*>(attachedWidget());
|
||||||
|
ASSERT(editor != NULL);
|
||||||
|
if (editor)
|
||||||
|
editor->notifyScrollChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void EditorView::onSetShowSpriteEditorScrollbars(bool state)
|
void EditorView::onSetShowSpriteEditorScrollbars(bool state)
|
||||||
{
|
{
|
||||||
setupScrollbars();
|
setupScrollbars();
|
||||||
|
@ -39,6 +39,7 @@ namespace app {
|
|||||||
protected:
|
protected:
|
||||||
void onPaint(ui::PaintEvent& ev) OVERRIDE;
|
void onPaint(ui::PaintEvent& ev) OVERRIDE;
|
||||||
void onResize(ui::ResizeEvent& ev) OVERRIDE;
|
void onResize(ui::ResizeEvent& ev) OVERRIDE;
|
||||||
|
void onScrollChange() OVERRIDE;
|
||||||
|
|
||||||
// GlobalSettingsObserver impl
|
// GlobalSettingsObserver impl
|
||||||
void onSetShowSpriteEditorScrollbars(bool state) OVERRIDE;
|
void onSetShowSpriteEditorScrollbars(bool state) OVERRIDE;
|
||||||
|
@ -188,6 +188,8 @@ void View::setViewScroll(const Point& pt)
|
|||||||
m_scrollbar_v.setPos(newScroll.y);
|
m_scrollbar_v.setPos(newScroll.y);
|
||||||
|
|
||||||
m_viewport.layout();
|
m_viewport.layout();
|
||||||
|
|
||||||
|
onScrollChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::updateView()
|
void View::updateView()
|
||||||
@ -273,4 +275,9 @@ void View::onPaint(PaintEvent& ev)
|
|||||||
getTheme()->paintView(ev);
|
getTheme()->paintView(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::onScrollChange()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
@ -59,6 +59,8 @@ protected:
|
|||||||
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
|
void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE;
|
||||||
void onPaint(PaintEvent& ev) OVERRIDE;
|
void onPaint(PaintEvent& ev) OVERRIDE;
|
||||||
|
|
||||||
|
virtual void onScrollChange();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_hasBars;
|
bool m_hasBars;
|
||||||
Viewport m_viewport;
|
Viewport m_viewport;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user