diff --git a/DesktopEditor/graphics/aggplustypes.h b/DesktopEditor/graphics/aggplustypes.h index c6a231dc08..7240561b83 100644 --- a/DesktopEditor/graphics/aggplustypes.h +++ b/DesktopEditor/graphics/aggplustypes.h @@ -212,7 +212,7 @@ public: void Offset(const PointF_T& point) { Offset(point.X, point.Y); } void Offset(T dx, T dy) { X += dx; Y += dy; } - inline bool IsPositive() { return X >= 0 && Y >= 0 && Width > 0 && Height > 0; } + inline bool IsPositive() { return Width > 0 && Height > 0; } public: T X, Y, Width, Height; diff --git a/DesktopEditor/raster/PICT/PICFile.cpp b/DesktopEditor/raster/PICT/PICFile.cpp index d6aac2a372..ae44fc7da9 100644 --- a/DesktopEditor/raster/PICT/PICFile.cpp +++ b/DesktopEditor/raster/PICT/PICFile.cpp @@ -1070,10 +1070,12 @@ unsigned int CPictFile::ReadLongValue() bool CPictFile::ReadRectangle(Aggplus::Rect* rect) { - rect->Y = ReadShortValue(); - rect->X = ReadShortValue(); - rect->Height = ReadShortValue() - rect->Y; - rect->Width = ReadShortValue() - rect->X; + rect->Y = (short) ReadShortValue(); + rect->X = (short) ReadShortValue(); + short bottom = (short) ReadShortValue(); + short right = (short) ReadShortValue(); + rect->Height = bottom - rect->Y; + rect->Width = right - rect->X; if (feof(m_pFile) != 0) return false;