mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 02:24:51 +02: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;
|
QRect fromImage;
|
||||||
if (_wantClipFromImage) {
|
if (_wantClipFromImage) {
|
||||||
fromImage = _fromImage;
|
float scaleX = imageWidth / _texture->getOriginalWidth();
|
||||||
float originalWidth = _texture->getOriginalWidth();
|
float scaleY = imageHeight / _texture->getOriginalHeight();
|
||||||
float originalHeight = _texture->getOriginalHeight();
|
|
||||||
float scaleX = imageWidth / originalWidth;
|
|
||||||
float scaleY = imageHeight / originalHeight;
|
|
||||||
fromImage.setX(scaleX * _fromImage.x());
|
fromImage.setX(scaleX * _fromImage.x());
|
||||||
fromImage.setY(scaleY * _fromImage.y());
|
fromImage.setY(scaleY * _fromImage.y());
|
||||||
fromImage.setWidth(scaleX * _fromImage.width());
|
fromImage.setWidth(scaleX * _fromImage.width());
|
||||||
|
|
Loading…
Reference in a new issue