diff --git a/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp b/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp index bcee199..ceef5cf 100644 --- a/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp +++ b/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp @@ -106,13 +106,9 @@ void SimpleElement::paint(QPainter* painter, QTransform transform, const LayerSt } else { - double angle = atan(transform.m12() / transform.m11()); - double maxScale; - if (fabs(cos(angle))>1e-5) - maxScale = std::max(fabs(transform.m11() / cos(angle)), fabs(transform.m22() / cos(angle))); - else - maxScale = std::max(fabs(transform.m12() / sin(angle)), fabs(transform.m21() / sin(angle))); - double pixelRatio = maxScale * QGuiApplication::primaryScreen()->devicePixelRatio(); + float sx = sqrt(transform.m11() * transform.m11() + transform.m12() * transform.m12()); + float sy = sqrt(transform.m21() * transform.m21() + transform.m22() * transform.m22()); + double pixelRatio = std::max(sx, sy) * QGuiApplication::primaryScreen()->devicePixelRatio() * 2; //double pixelRatio = 5; if (painterPath == painterPathPrev && styles.getHash() == stylesHashValue && pixelRatioPrev >= pixelRatio && !forceRefresh) {