D29705: Correctly align natural layout in present windows

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added a comment.


  Hmm, so we effectively deal with two coordinate spaces... `rect / scale` will map `rect` from the "area" coordinate space to the "bounds" coordinate space. `rect * scale` will map `rect` from the "bounds" coordinate space to "area" coordinate space.
  
  - `bounds.x()` is in the "bounds" coordinate space while `(area.width() - 20 - bounds.width() * scale) / 2` is in the "area" coordinate space
  - `bounds.y()` is in the "bounds" coordinate space while `(area.height() - 20 - bounds.height() * scale) / 2` is in the "area" coordinate space
  
  It seems like instead of multiplying `bounds.width()` and `bounds.height()` by `scale` we could instead divide `area.width()` and `area.height()` by scale to simply math, e.g.
  
    bounds.x() - (area.width() / scale - bounds.width()) / 2,
    bounds.y() - (area.height() / scale - bounds.height()) / 2,

REPOSITORY
  R108 KWin

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D29705

To: davidedmundson, #kwin, apol, broulik
Cc: zzag, apol, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, ahiemstra, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.