Fix scaling point label.
--HG-- branch : develop
This commit is contained in:
parent
95a21e07cc
commit
da2cc857df
|
@ -82,7 +82,7 @@ qreal ScaledRadius(qreal scale)
|
||||||
qreal scaledRadius = defPointRadiusPixel;
|
qreal scaledRadius = defPointRadiusPixel;
|
||||||
if (scale > 1)
|
if (scale > 1)
|
||||||
{
|
{
|
||||||
scaledRadius = qMax(defPointRadiusPixel/12, defPointRadiusPixel/scale);
|
scaledRadius = qMax(defPointRadiusPixel/96, defPointRadiusPixel/scale);
|
||||||
}
|
}
|
||||||
return scaledRadius;
|
return scaledRadius;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ qreal ScaleWidth(qreal width, qreal scale)
|
||||||
{
|
{
|
||||||
if (scale > 1)
|
if (scale > 1)
|
||||||
{
|
{
|
||||||
width = qMax(0.1, width/scale);
|
width = qMax(0.01, width/scale);
|
||||||
}
|
}
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,16 +85,11 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphic
|
||||||
void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
const qreal scale = SceneScale(scene());
|
const qreal scale = SceneScale(scene());
|
||||||
qreal fontSize = BaseFontSize();
|
|
||||||
if (scale > 1)
|
if (scale > 1)
|
||||||
{
|
{
|
||||||
fontSize = qMax(0.1, fontSize/scale);
|
setScale(1/scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
QFont font = this->font();
|
|
||||||
font.setPointSizeF(fontSize);
|
|
||||||
setFont(font);
|
|
||||||
|
|
||||||
QGraphicsSimpleTextItem::paint(painter, option, widget);
|
QGraphicsSimpleTextItem::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ void VScenePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
|
||||||
{
|
{
|
||||||
const qreal scale = SceneScale(scene());
|
const qreal scale = SceneScale(scene());
|
||||||
|
|
||||||
if (m_namePoint->BaseFontSize()*scale < 1)
|
if (m_namePoint->BaseFontSize()*scale < 5)
|
||||||
{
|
{
|
||||||
m_namePoint->setVisible(false);
|
m_namePoint->setVisible(false);
|
||||||
m_lineName->setVisible(false);
|
m_lineName->setVisible(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user