mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Cleanup image clipping in ImageOverlay
This commit is contained in:
parent
d27a26967f
commit
6a9f135e1c
1 changed files with 3 additions and 5 deletions
|
@ -92,11 +92,9 @@ void ImageOverlay::render(RenderArgs* args) {
|
|||
|
||||
QRect fromImage;
|
||||
if (_wantClipFromImage) {
|
||||
fromImage = _fromImage;
|
||||
float originalWidth = _texture->getOriginalWidth();
|
||||
float originalHeight = _texture->getOriginalHeight();
|
||||
float scaleX = imageWidth / originalWidth;
|
||||
float scaleY = imageHeight / originalHeight;
|
||||
float scaleX = imageWidth / _texture->getOriginalWidth();
|
||||
float scaleY = imageHeight / _texture->getOriginalHeight();
|
||||
|
||||
fromImage.setX(scaleX * _fromImage.x());
|
||||
fromImage.setY(scaleY * _fromImage.y());
|
||||
fromImage.setWidth(scaleX * _fromImage.width());
|
||||
|
|
Loading…
Reference in a new issue