mirror of
https://github.com/leozide/leocad
synced 2025-02-05 08:45:55 +01:00
Better ortho zoom.
This commit is contained in:
parent
ff18a2057d
commit
098ee45e5b
1 changed files with 3 additions and 2 deletions
|
@ -831,8 +831,9 @@ void lcCamera::ZoomExtents(float AspectRatio, const lcVector3& Center, const std
|
|||
MaxY = lcMax(MaxY, Point.y);
|
||||
}
|
||||
|
||||
float Width = qMax(fabsf(MaxX), fabsf(MinX)) * 2;
|
||||
float Height = qMax(fabsf(MaxY), fabsf(MinY)) * 2;
|
||||
lcVector3 ViewCenter = lcMul30(Center, mWorldView);
|
||||
float Width = qMax(fabsf(MaxX - Center.x), fabsf(Center.x - MinX)) * 2;
|
||||
float Height = qMax(fabsf(MaxY - Center.y), fabsf(Center.y - MinY)) * 2;
|
||||
|
||||
if (Width > Height * AspectRatio)
|
||||
Height = Width / AspectRatio;
|
||||
|
|
Loading…
Add table
Reference in a new issue