Skip to content

Commit

Permalink
fixup! 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 8b4f9f8 commit c4f98ad
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ void CaptureWidget::positionWindow(const CaptureRequest& req)
// Set the gui window to be over just one screen.
// TODO: verify initial selection is within this screen
// TODO: make the windows case not override this
topLeft = selectedScreen->geometry().topLeft();
topLeft.setX(selectedScreen->geometry().topLeft().x());
topLeft.setY(selectedScreen->geometry().topLeft().y());
//topLeft = selectedScreen->geometry().topLeft();
AbstractLogger::error() << "window top left: x="
<< QStringLiteral("%1").arg(topLeft.x())
<< " y=" << QStringLiteral("%1").arg(topLeft.y());
Expand Down Expand Up @@ -483,7 +485,10 @@ void CaptureWidget::initHelpMessage()
);
keyMap << QPair("Selected Screen Top Left", QStringLiteral("%1x%2").arg(topLeft.x()).arg(topLeft.y()));
for (QScreen* const screen : QGuiApplication::screens()) {
QPoint topLeftScreen = screen->geometry().topLeft();
QPoint topLeftScreen(
screen->geometry().topLeft().x(),
screen->geometry().topLeft().y()
);
keyMap << QPair("Some Screen Top Left", QStringLiteral("%1x%2").arg(topLeftScreen.x()).arg(topLeftScreen.y()));

if (topLeftScreen.x() < topLeft.x()) {
Expand Down Expand Up @@ -639,10 +644,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))
.arg(static_cast<int>(final_geometry.width() * scale))
.arg(static_cast<int>(final_geometry.height() * scale))
.arg(static_cast<int>(final_geometry.left() * scale))
.arg(static_cast<int>(final_geometry.top() * scale))
;

xybox = fm.boundingRect(xy);
Expand Down

0 comments on commit c4f98ad

Please sign in to comment.