Fixed #3569: Y axe correction for clear rect

And also: Refactor #3370: Window adaptation fixed for Mi 2