Fix Editor::editor_request_size() to return more viewport space (at least 1/4 of sprite is visible).

This commit is contained in:
David Capello 2011-10-30 14:33:27 -03:00
parent 1526e30f4c
commit 7ca8ed8688

View File

@ -1033,8 +1033,8 @@ void Editor::editor_request_size(int *w, int *h)
View* view = View::getView(this);
Rect vp = view->getViewportBounds();
m_offset_x = vp.w/2 - 1;
m_offset_y = vp.h/2 - 1;
m_offset_x = vp.w - m_sprite->getWidth()/2;
m_offset_y = vp.h - m_sprite->getHeight()/2;
*w = (m_sprite->getWidth() << m_zoom) + m_offset_x*2;
*h = (m_sprite->getHeight() << m_zoom) + m_offset_y*2;