Minor changes about how aspect ratio is presented on the status bar

This commit is contained in:
David Capello 2019-04-10 13:51:15 -03:00
parent d161d6936a
commit 59361a3b6d
2 changed files with 7 additions and 4 deletions

View File

@ -240,11 +240,10 @@ public:
gfx::Point offset = loop->statusBarPositionOffset();
char buf[1024];
int gcd = base::gcd(w, h);
sprintf(buf, ":start: %3d %3d :end: %3d %3d :size: %3d %3d :distance: %.1f :aspect_ratio: %2d : %2d",
sprintf(buf, ":start: %3d %3d :end: %3d %3d :size: %3d %3d :distance: %.1f",
stroke[0].x+offset.x, stroke[0].y+offset.y,
stroke[1].x+offset.x, stroke[1].y+offset.y,
w, h, std::sqrt(w*w + h*h),
w/gcd, h/gcd);
w, h, std::sqrt(w*w + h*h));
if (hasAngle() ||
loop->getIntertwine()->snapByAngle()) {
@ -257,6 +256,10 @@ public:
sprintf(buf+strlen(buf), " :angle: %.1f", 180.0 * angle / PI);
}
// Aspect ratio at the end
sprintf(buf+strlen(buf), " :aspect_ratio: %d:%d",
w/gcd, h/gcd);
text = buf;
}

View File

@ -469,7 +469,7 @@ bool MovingPixelsState::onUpdateStatusBar(Editor* editor)
int h = int(transform.bounds().h);
int gcd = base::gcd(w, h);
StatusBar::instance()->setStatusText
(100, ":pos: %d %d :size: %3d %3d :selsize: %d %d [%.02f%% %.02f%%] :angle: %.1f :aspect_ratio: %2d : %2d",
(100, ":pos: %d %d :size: %3d %3d :selsize: %d %d [%.02f%% %.02f%%] :angle: %.1f :aspect_ratio: %d:%d",
int(transform.bounds().x),
int(transform.bounds().y),
imageSize.w,