Merge pull request #704 from mahkoh/jorth/layer-margin
layer-shell: take margin into account when centering
This commit is contained in:
commit
69ed0c0ad4
1 changed files with 2 additions and 2 deletions
|
|
@ -501,14 +501,14 @@ impl ZwlrLayerSurfaceV1 {
|
|||
let mut x1 = 0;
|
||||
let mut y1 = 0;
|
||||
if anchor.contains(LEFT | RIGHT) {
|
||||
x1 = (owidth - width) / 2;
|
||||
x1 = ml + (owidth - width - ml - mr) / 2;
|
||||
} else if anchor.contains(LEFT) {
|
||||
x1 = ml;
|
||||
} else if anchor.contains(RIGHT) {
|
||||
x1 = owidth - width - mr;
|
||||
}
|
||||
if anchor.contains(TOP | BOTTOM) {
|
||||
y1 = (oheight - height) / 2;
|
||||
y1 = mt + (oheight - height - mt - mb) / 2;
|
||||
} else if anchor.contains(TOP) {
|
||||
y1 = mt;
|
||||
} else if anchor.contains(BOTTOM) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue