fix usages of QmlRect.right and .bottom
This commit is contained in:
@@ -47,8 +47,8 @@ class Desktop {
|
||||
return Qt.rect(
|
||||
left,
|
||||
top,
|
||||
right - left + 1,
|
||||
bottom - top + 1,
|
||||
right - left,
|
||||
bottom - top,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -89,10 +89,8 @@ class Grid {
|
||||
}
|
||||
|
||||
public getLeftmostVisibleColumn(visibleRange: Desktop.Range, fullyVisible: boolean) {
|
||||
const scrollX = visibleRange.getLeft();
|
||||
for (const column of this.columns.iterator()) {
|
||||
const x = fullyVisible ? column.getLeft() : column.getRight() + (this.config.gapsInnerHorizontal - 1);
|
||||
if (x >= scrollX) {
|
||||
if (column.isVisible(visibleRange, fullyVisible)) {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
@@ -100,13 +98,11 @@ class Grid {
|
||||
}
|
||||
|
||||
public getRightmostVisibleColumn(visibleRange: Desktop.Range, fullyVisible: boolean) {
|
||||
const scrollX = visibleRange.getRight();
|
||||
let last = null;
|
||||
for (const column of this.columns.iterator()) {
|
||||
const x = fullyVisible ? column.getRight() : column.getLeft() - (this.config.gapsInnerHorizontal - 1);
|
||||
if (x <= scrollX) {
|
||||
if (column.isVisible(visibleRange, fullyVisible)) {
|
||||
last = column;
|
||||
} else {
|
||||
} else if (last !== null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,10 +122,10 @@ class ClientWrapper {
|
||||
return;
|
||||
}
|
||||
const frame = this.kwinClient.frameGeometry;
|
||||
if (frame.left < 0) {
|
||||
frame.x = 0;
|
||||
} else if (frame.right > screenSize.width) {
|
||||
frame.x = screenSize.width - frame.width;
|
||||
if (frame.left < screenSize.left) {
|
||||
frame.x = screenSize.left;
|
||||
} else if (frame.right > screenSize.right) {
|
||||
frame.x = screenSize.right - frame.width;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ namespace PinManager {
|
||||
}
|
||||
|
||||
private contains(obstacle: QmlRect) {
|
||||
return obstacle.right >= this.left && obstacle.left <= this.right &&
|
||||
obstacle.bottom >= this.top && obstacle.top <= this.bottom;
|
||||
return obstacle.right > this.left && obstacle.left < this.right &&
|
||||
obstacle.bottom > this.top && obstacle.top < this.bottom;
|
||||
}
|
||||
|
||||
public area() {
|
||||
|
||||
Reference in New Issue
Block a user