region selector: add selection padding to target regions

This commit is contained in:
end-4
2025-11-05 12:13:46 +01:00
parent 6ca5175bb0
commit 923841cb56
2 changed files with 6 additions and 4 deletions
@@ -377,6 +377,7 @@ Singleton {
property bool showLabel: false
property real opacity: 0.3
property real contentRegionOpacity: 0.8
property int selectionPadding: 5
}
property JsonObject rect: JsonObject {
property bool showAimLines: true
@@ -121,10 +121,11 @@ PanelWindow {
return (root.targetedRegionX >= 0 && root.targetedRegionY >= 0)
}
function setRegionToTargeted() {
root.regionX = root.targetedRegionX;
root.regionY = root.targetedRegionY;
root.regionWidth = root.targetedRegionWidth;
root.regionHeight = root.targetedRegionHeight;
const padding = Config.options.regionSelector.targetRegions.selectionPadding; // Make borders not cut off n stuff
root.regionX = root.targetedRegionX - padding;
root.regionY = root.targetedRegionY - padding;
root.regionWidth = root.targetedRegionWidth + padding * 2;
root.regionHeight = root.targetedRegionHeight + padding * 2;
}
function updateTargetedRegion(x, y) {