Skip to content

Commit

Permalink
wip: emulate geom change before export
Browse files Browse the repository at this point in the history
  • Loading branch information
toofar committed Dec 28, 2023
1 parent 227f6e5 commit 8b4f9f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ void CaptureWidget::paintEvent(QPaintEvent* paintEvent)
QRect xybox;
QFontMetrics fm = painter.fontMetrics();

QRect final_geometry(m_context.selection);
final_geometry.setTopLeft(final_geometry.topLeft() + m_context.widgetOffset);
QString xy = QString("%1x%2+%3+%4\n%5x%6+%7+%8")
.arg(static_cast<int>(selection.width() * scale))
.arg(static_cast<int>(selection.height() * scale))
Expand All @@ -637,6 +639,10 @@ void CaptureWidget::paintEvent(QPaintEvent* paintEvent)
.arg(static_cast<int>(m_context.selection.height() * scale))
.arg(static_cast<int>(m_context.selection.left() * scale))
.arg(static_cast<int>(m_context.selection.top() * scale))
.arg(static_cast<int>(final_geometry.selection.width() * scale))
.arg(static_cast<int>(final_geometry.selection.height() * scale))
.arg(static_cast<int>(final_geometry.selection.left() * scale))
.arg(static_cast<int>(final_geometry.selection.top() * scale))
;

xybox = fm.boundingRect(xy);
Expand Down

0 comments on commit 8b4f9f8

Please sign in to comment.