Display bug for non-rectangular components in DrawinQuery::drawGo().

* Bug: In CellWidget::DrawingQuery::drawGo(), the display condition was
    wrong, it was requiring *both* width & height to be above the display
    threshold. Either one is sufficient to activate the display.
      Was causing the selective diseapearance of gates at low zoom level
    and printed version.
* Change: In CellPrinter, force the display threshold to one pixel in it's
    internal CellWidget used for printing.
This commit is contained in:
Jean-Paul Chaput 2021-12-25 15:23:49 +01:00
parent fdce75fdad
commit 5f8a0a944c
4 changed files with 14 additions and 3 deletions

View File

@ -865,9 +865,13 @@ void QuadTree_GosUnder::Locator::progress()
// if (isValid()) {
// if (( (getElement()->getBoundingBox().getWidth () < _threshold)
// and (getElement()->getBoundingBox().getHeight() < _threshold)) )
// cerr << " goUnders: pruning " << getElement() << endl;
// cerr << " goUnders: pruning " << DbU::getValueString(_threshold)
// << " " << getElement() << endl;
// else
// cerr << " goUnders: display " << getElement() << endl;
// cerr << " goUnders: display " << DbU::getValueString(_threshold)
// << " w:" << DbU::getValueString(getElement()->getBoundingBox().getWidth ())
// << " h:" << DbU::getValueString(getElement()->getBoundingBox().getHeight())
// << " " << getElement() << endl;
// }
} while ( isValid()
and ( not getElement()->getBoundingBox().intersect(_area)

View File

@ -82,6 +82,7 @@ namespace Hurricane {
setCentralWidget( _cellWidget );
_palette->readGraphics ();
_cellWidget->setPixelThreshold( 1 );
_cellWidget->setPrinter( true );
_cellWidget->bindToPalette( _palette );
_cellWidget->refresh();

View File

@ -676,7 +676,7 @@ namespace Hurricane {
rectangle = _cellWidget->dbuToScreenRect( bb );
if (component->isNonRectangle()) {
if ( (rectangle.width() > 4) and (rectangle.height() > 4) ) {
if ( (rectangle.width() > 4) or (rectangle.height() > 4) ) {
QPolygon contour;
for ( Point point : component->getContour() )
contour << _cellWidget->dbuToScreenPoint( transformation.getPoint(point) );

View File

@ -151,6 +151,7 @@ namespace Hurricane {
inline bool showBoundaries () const;
inline bool showSelection () const;
inline bool cumulativeSelection () const;
inline void setPixelThreshold ( int );
inline void setDbuMode ( int );
inline void setUnitPower ( DbU::UnitPower );
inline void setRubberShape ( RubberShape );
@ -1114,9 +1115,14 @@ namespace Hurricane {
{ return _scaleHistory[_ihistory]._scale; }
inline void CellWidget::setPixelThreshold ( int pixelThreshold )
{ _pixelThreshold = pixelThreshold; }
inline int CellWidget::getPixelThreshold () const
{ return _pixelThreshold; }
inline CellWidget::FindStateName::FindStateName ( const Name& cellHierName )
: unary_function< const shared_ptr<State>&, bool >()
, _cellHierName(cellHierName)