Fix: GraphicElement中pixelRatio的计算
parent
5d5ea2307f
commit
a55a38385e
|
@ -106,13 +106,9 @@ void SimpleElement::paint(QPainter* painter, QTransform transform, const LayerSt
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double angle = atan(transform.m12() / transform.m11());
|
float sx = sqrt(transform.m11() * transform.m11() + transform.m12() * transform.m12());
|
||||||
double maxScale;
|
float sy = sqrt(transform.m21() * transform.m21() + transform.m22() * transform.m22());
|
||||||
if (fabs(cos(angle))>1e-5)
|
double pixelRatio = std::max(sx, sy) * QGuiApplication::primaryScreen()->devicePixelRatio() * 2;
|
||||||
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();
|
|
||||||
//double pixelRatio = 5;
|
//double pixelRatio = 5;
|
||||||
if (painterPath == painterPathPrev && styles.getHash() == stylesHashValue && pixelRatioPrev >= pixelRatio && !forceRefresh)
|
if (painterPath == painterPathPrev && styles.getHash() == stylesHashValue && pixelRatioPrev >= pixelRatio && !forceRefresh)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue