1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 00:12:50 -05:00

screenshot/colorpicker: fix scaling, update go-wayland to fix object

destruction, fix hyprland window detection
This commit is contained in:
bbedward
2025-12-07 13:44:35 -05:00
parent 308c8c3ea7
commit 3ae1973e21
18 changed files with 564 additions and 174 deletions

View File

@@ -223,16 +223,23 @@ func (r *RegionSelector) finishSelection() {
dstData := cropped.Data()
for y := 0; y < h; y++ {
srcY := by1 + y
if srcY >= srcBuf.Height {
break
if os.yInverted {
srcY = srcBuf.Height - 1 - (by1 + y)
}
if srcY < 0 || srcY >= srcBuf.Height {
continue
}
dstY := y
if os.yInverted {
dstY = h - 1 - y
}
for x := 0; x < w; x++ {
srcX := bx1 + x
if srcX >= srcBuf.Width {
break
if srcX < 0 || srcX >= srcBuf.Width {
continue
}
si := srcY*srcBuf.Stride + srcX*4
di := y*cropped.Stride + x*4
di := dstY*cropped.Stride + x*4
if si+3 < len(srcData) && di+3 < len(dstData) {
dstData[di+0] = srcData[si+0]
dstData[di+1] = srcData[si+1]