1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix adventure map rendering

This commit is contained in:
Ivan Savenko 2024-07-22 13:35:56 +00:00
parent 954b6b0947
commit 0f4bd7253d

View File

@ -46,7 +46,8 @@ Canvas::Canvas(Canvas && other):
Canvas::Canvas(const Canvas & other, const Rect & newClipRect):
Canvas(other)
{
renderArea = other.renderArea.intersect(newClipRect + other.renderArea.topLeft());
Rect scaledClipRect( transformPos(newClipRect.topLeft()), transformPos(newClipRect.dimensions()));
renderArea = other.renderArea.intersect(scaledClipRect + other.renderArea.topLeft());
}
Canvas::Canvas(const Point & size, CanvasScalingPolicy scalingPolicy):
@ -67,7 +68,7 @@ int Canvas::getScalingFactor() const
Point Canvas::transformPos(const Point & input)
{
return (renderArea.topLeft() + input) * getScalingFactor();
return renderArea.topLeft() + input * getScalingFactor();
}
Point Canvas::transformSize(const Point & input)