Mercurial > hg > svgui
comparison widgets/LevelPanToolButton.cpp @ 934:325a7aa69055 tonioni
Fix possible excess image size
| author | Chris Cannam | 
|---|---|
| date | Wed, 25 Mar 2015 11:48:33 +0000 | 
| parents | 9022635c615a | 
| children | a61a779d73df | 
   comparison
  equal
  deleted
  inserted
  replaced
| 933:9022635c615a | 934:325a7aa69055 | 
|---|---|
| 132 | 132 | 
| 133 void | 133 void | 
| 134 LevelPanToolButton::paintEvent(QPaintEvent *e) | 134 LevelPanToolButton::paintEvent(QPaintEvent *e) | 
| 135 { | 135 { | 
| 136 QToolButton::paintEvent(e); | 136 QToolButton::paintEvent(e); | 
| 137 if (m_pixels >= height()) { | |
| 138 setImageSize(height()-1); | |
| 139 } | |
| 137 double margin = (double(height()) - m_pixels) / 2.0; | 140 double margin = (double(height()) - m_pixels) / 2.0; | 
| 138 m_lpw->renderTo(this, QRectF(margin, margin, m_pixels, m_pixels), false); | 141 m_lpw->renderTo(this, QRectF(margin, margin, m_pixels, m_pixels), false); | 
| 139 } | 142 } | 
| 140 | 143 | 
| 141 | 144 | 
