SDL: Clip mouse range in convertVirtualToWindow
This commit is contained in:
parent
a382a6dd30
commit
a5a45fdae1
1 changed files with 6 additions and 3 deletions
|
@ -102,8 +102,11 @@ protected:
|
|||
error("convertVirtualToWindow called without a valid draw rect");
|
||||
}
|
||||
|
||||
return Common::Point(targetX + (x * targetWidth + sourceWidth / 2) / sourceWidth,
|
||||
targetY + (y * targetHeight + sourceHeight / 2) / sourceHeight);
|
||||
int windowX = targetX + (x * targetWidth + sourceWidth / 2) / sourceWidth;
|
||||
int windowY = targetY + (y * targetHeight + sourceHeight / 2) / sourceHeight;
|
||||
|
||||
return Common::Point(CLIP<int>(windowX, targetX, targetX + targetWidth - 1),
|
||||
CLIP<int>(windowY, targetY, targetY + targetHeight - 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue