mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Merge pull request #383 from plc-user/master
adjust zoom-factor to use cosmetic-line and fixed comments
This commit is contained in:
commit
3c2c889922
@ -519,8 +519,8 @@ void Conductor::paint(QPainter *painter, const QStyleOptionGraphicsItem *options
|
|||||||
final_conductor_pen.setStyle(m_properties.style);
|
final_conductor_pen.setStyle(m_properties.style);
|
||||||
final_conductor_pen.setJoinStyle(Qt::SvgMiterJoin); // better rendering with dot
|
final_conductor_pen.setJoinStyle(Qt::SvgMiterJoin); // better rendering with dot
|
||||||
|
|
||||||
//Use a cosmetique line, below a certain zoom
|
//Use a cosmetic line, below a certain zoom
|
||||||
if (options && options->levelOfDetailFromTransform(painter->worldTransform()) < 1.0)
|
if (options && options->levelOfDetailFromTransform(painter->worldTransform()) < 0.5)
|
||||||
{
|
{
|
||||||
final_conductor_pen.setCosmetic(true);
|
final_conductor_pen.setCosmetic(true);
|
||||||
}
|
}
|
||||||
|
@ -215,24 +215,24 @@ void Element::paint(
|
|||||||
drawHighlight(painter, options);
|
drawHighlight(painter, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set default pen and brush to QPainter
|
//Set default pen and brush to QPainter to avoid a strange bug when
|
||||||
//for avoid a strange bug when the Qt theme is a "dark" theme.
|
//the Qt theme is a "dark" theme.
|
||||||
//Some part of an element are gray or white instead of black.
|
//Some parts of an element are gray or white instead of black.
|
||||||
//This bug seems append only when the QPainter use drawPicture method.
|
//This bug seems append only when the QPainter uses drawPicture method.
|
||||||
//See bug 175. https://qelectrotech.org/bugtracker/view.php?id=175
|
//See bug 175. https://qelectrotech.org/bugtracker/view.php?id=175
|
||||||
painter->save();
|
painter->save();
|
||||||
QPen pen;
|
QPen pen;
|
||||||
QBrush brush;
|
QBrush brush;
|
||||||
painter->setPen(pen);
|
painter->setPen(pen);
|
||||||
painter->setBrush(brush);
|
painter->setBrush(brush);
|
||||||
if (options && options->levelOfDetailFromTransform(painter->worldTransform()) < 1.0)
|
if (options && options->levelOfDetailFromTransform(painter->worldTransform()) < 0.5)
|
||||||
{
|
{
|
||||||
painter->drawPicture(0, 0, m_low_zoom_picture);
|
painter->drawPicture(0, 0, m_low_zoom_picture);
|
||||||
} else {
|
} else {
|
||||||
painter->drawPicture(0, 0, m_picture);
|
painter->drawPicture(0, 0, m_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->restore(); //Restorr the QPainter after use drawPicture
|
painter->restore(); //Restore the QPainter after use drawPicture
|
||||||
|
|
||||||
//Draw the selection rectangle
|
//Draw the selection rectangle
|
||||||
if ( isSelected() || m_mouse_over ) {
|
if ( isSelected() || m_mouse_over ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user