diff --git a/uppsrc/Core/Gtypes.cpp b/uppsrc/Core/Gtypes.cpp index 2291e61b7..0bd348bcd 100644 --- a/uppsrc/Core/Gtypes.cpp +++ b/uppsrc/Core/Gtypes.cpp @@ -101,6 +101,16 @@ Size GetFitSize(Size sz, int cx, int cy) return iscale(sz, cx, sz.cx); } +Sizef GetFitSize(Sizef sz, double cx, double cy) +{ + if(cx <= 0 || cy <= 0 || sz.cx <= 0 || sz.cy <= 0) + return Size(0, 0); + if(cx * sz.cy >= cy * sz.cx) // too high + return sz * cy / sz.cy; + else + return sz * cx / sz.cx; +} + double SquareDist(const Pointf& p1, const Pointf& p2) { return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y); diff --git a/uppsrc/Core/Gtypes.h b/uppsrc/Core/Gtypes.h index bc3fca930..0586c3930 100644 --- a/uppsrc/Core/Gtypes.h +++ b/uppsrc/Core/Gtypes.h @@ -722,6 +722,9 @@ Size GetRatioSize(Size stdsize, int cx, int cy); Size GetFitSize(Size objsize, int cx, int cy); inline Size GetFitSize(Size objsize, Size intosize) { return GetFitSize(objsize, intosize.cx, intosize.cy); } +Sizef GetFitSize(Sizef sz, double cx, double cy); +inline Sizef GetFitSize(Sizef objsize, Sizef intosize) { return GetFitSize(objsize, intosize.cx, intosize.cy); } + Pointf Mid(const Pointf& a, const Pointf& b); Pointf Orthogonal(const Pointf& p); double Squared(const Pointf& p); diff --git a/uppsrc/CtrlLib/init b/uppsrc/CtrlLib/init index 824dec6ba..3c90182ca 100644 --- a/uppsrc/CtrlLib/init +++ b/uppsrc/CtrlLib/init @@ -2,7 +2,7 @@ #define _CtrlLib_icpp_init_stub #include "CtrlCore/init" #include "PdfDraw/init" -#define BLITZ_INDEX__ F2a95805f3896075b0a556396aabaf515 +#define BLITZ_INDEX__ Fa588a2a7bb40a3ed36760f6c2bef5026 #include "CtrlLib.icpp" #undef BLITZ_INDEX__ #endif