Fix scaling point label.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-09-30 21:13:22 +03:00
parent 95a21e07cc
commit da2cc857df
3 changed files with 4 additions and 9 deletions

View File

@ -82,7 +82,7 @@ qreal ScaledRadius(qreal scale)
qreal scaledRadius = defPointRadiusPixel;
if (scale > 1)
{
scaledRadius = qMax(defPointRadiusPixel/12, defPointRadiusPixel/scale);
scaledRadius = qMax(defPointRadiusPixel/96, defPointRadiusPixel/scale);
}
return scaledRadius;
}
@ -100,7 +100,7 @@ qreal ScaleWidth(qreal width, qreal scale)
{
if (scale > 1)
{
width = qMax(0.1, width/scale);
width = qMax(0.01, width/scale);
}
return width;
}

View File

@ -85,16 +85,11 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphic
void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
const qreal scale = SceneScale(scene());
qreal fontSize = BaseFontSize();
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);
}

View File

@ -63,7 +63,7 @@ void VScenePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
{
const qreal scale = SceneScale(scene());
if (m_namePoint->BaseFontSize()*scale < 1)
if (m_namePoint->BaseFontSize()*scale < 5)
{
m_namePoint->setVisible(false);
m_lineName->setVisible(false);