Improve status bar text when the user is scaling/rotating the selection.

This commit is contained in:
David Capello 2012-01-07 16:35:04 -03:00
parent 89da817771
commit 9684672f5f
3 changed files with 13 additions and 1 deletions

View File

@ -263,11 +263,16 @@ bool MovingPixelsState::onUpdateStatusBar(Editor* editor)
ASSERT(m_pixelsMovement != NULL);
const gfx::Transformation& transform(getTransformation(editor));
Document* document = editor->getDocument();
gfx::Size imageSize = m_pixelsMovement->getInitialImageSize();
app_get_statusbar()->setStatusText
(100, "Pos %d %d, Size %d %d, Angle %.1f",
(100, "Pos %d %d, Size %d %d, Orig: %3d %3d (%.02f%% %.02f%%), Angle %.1f",
transform.bounds().x, transform.bounds().y,
transform.bounds().w, transform.bounds().h,
imageSize.w, imageSize.h,
(double)transform.bounds().w*100.0/imageSize.w,
(double)transform.bounds().h*100.0/imageSize.h,
180.0 * transform.angle() / PI);
return true;

View File

@ -379,6 +379,11 @@ gfx::Rect PixelsMovement::getImageBounds()
return gfx::Rect(cel->getX(), cel->getY(), image->w, image->h);
}
gfx::Size PixelsMovement::getInitialImageSize() const
{
return m_initialData.bounds().getSize();
}
void PixelsMovement::setMaskColor(uint32_t mask_color)
{
{

View File

@ -22,6 +22,7 @@
#include "document_wrappers.h"
#include "undo_transaction.h"
#include "widgets/editor/handle_type.h"
#include "gfx/size.h"
class Document;
class Image;
@ -60,6 +61,7 @@ public:
bool isDragging() const;
gfx::Rect getImageBounds();
gfx::Size getInitialImageSize() const;
void setMaskColor(uint32_t mask_color);