mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-12-04 04:11:38 +00:00
Space.globalToSpace coordinate transform util
This commit is contained in:
committed by
Tor Hedin Brønner
parent
ce969e77f3
commit
a48dd56bf0
@@ -774,6 +774,14 @@ class Space extends Array {
|
||||
return column.indexOf(metaWindow);
|
||||
}
|
||||
|
||||
/** Transform global coordinates to scroll cooridinates (cloneContainer relative) */
|
||||
globalToScroll(gx, gy, useTarget=false) {
|
||||
// NB: must use this.cloneContainer.transform_stage_point(gx, gy) if stuff is not simply translated
|
||||
let x = gx - this.monitor.x - (useTarget ? this.targetX : this.cloneContainer.x);
|
||||
let y = gy - this.monitor.y - this.cloneContainer.y;
|
||||
return [x, y];
|
||||
}
|
||||
|
||||
moveDone() {
|
||||
if (this.cloneContainer.x !== this.targetX ||
|
||||
this.actor.y !== 0 ||
|
||||
|
||||
Reference in New Issue
Block a user