1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

screenshot: add shift to perfect-square capability

This commit is contained in:
bbedward
2025-12-05 17:08:00 -05:00
parent 7f11632ea6
commit 22b2b69413
3 changed files with 57 additions and 9 deletions

View File

@@ -114,6 +114,13 @@ func (r *RegionSelector) drawOverlay(os *OutputSurface, renderBuf *ShmBuffer) {
}
selW, selH := bx2-bx1+1, by2-by1+1
if r.shiftHeld && selW != selH {
if selW < selH {
selH = selW
} else {
selW = selH
}
}
r.drawBorder(data, stride, w, h, bx1, by1, selW, selH)
r.drawDimensions(data, stride, w, h, bx1, by1, selW, selH)
}