Modified status bar text when we are dragging pixels in the editor.

+ Added PixelsMovement::getImageBounds() method.
This commit is contained in:
David Capello 2010-07-14 20:02:18 -03:00
parent ec06ad824f
commit 81fcdb53a3
3 changed files with 23 additions and 1 deletions

View File

@ -1161,8 +1161,16 @@ bool Editor::msg_proc(JMessage msg)
jmouse_show();
}
}
}
editor_update_statusbar_for_standby();
// Update status bar for when the user is dragging pixels
{
// int x, y;
// screen_to_editor(msg->mouse.x, msg->mouse.y, &x, &y);
Rect bounds = m_pixelsMovement->getImageBounds();
app_get_statusbar()->setStatusText
(0, "Pos %d %d, Size %d %d [Press Ctrl+D to deselect]",
bounds.x, bounds.y, bounds.w, bounds.h);
}
}
// In tool-loop

View File

@ -162,6 +162,13 @@ public:
return m_isDragging;
}
Rect getImageBounds()
{
Cel* cel = m_sprite_writer->getExtraCel();
Image* image = m_sprite_writer->getExtraCelImage();
return Rect(cel->x, cel->y, image->w, image->h);
}
};
//////////////////////////////////////////////////////////////////////
@ -211,3 +218,8 @@ bool PixelsMovement::isDragging()
{
return m_impl->isDragging();
}
Rect PixelsMovement::getImageBounds()
{
return m_impl->getImageBounds();
}

View File

@ -43,6 +43,8 @@ public:
void dropImage();
bool isDragging();
Rect getImageBounds();
private:
class PixelsMovementImpl* m_impl;
};