-void SmallRuler::paintEvent(QPaintEvent *e) {
- // debug ("KRuler::drawContents, %s",(horizontal==dir)?"horizontal":"vertical");
-
- QStylePainter p(this);
- p.fillRect(e->rect(), QBrush(QColor(Qt::white)));
-
-
- int value = this->value(),
- minval = minimum(),
- maxval;
- maxval = maximum()
- + offset() - endOffset();
-
- //ioffsetval = value-offset;
- // pixelpm = (int)ppm;
- // left = clip.left(),
- // right = clip.right();
- double f, fend,
- offsetmin = (double)(minval - offset()),
- offsetmax = (double)(maxval - offset()),
- fontOffset = (((double)minval) > offsetmin) ? (double)minval : offsetmin;
-
- // draw labels
- QFont font = p.font();
- font.setPointSize(LABEL_SIZE);
- p.setFont(font);
-
- if (showLittleMarks()) {
+void SmallRuler::paintEvent(QPaintEvent *e)
+{
+
+ QPainter p(this);
+ QRect r = e->rect();
+ p.setClipRect(r);
+
+ double f, fend;
+ p.setPen(palette().dark().color());
+
+ const int zoneStart = (int)(m_zoneStart * m_scale);
+ const int zoneEnd = (int)(m_zoneEnd * m_scale);
+
+ p.fillRect(zoneStart, height() / 2, zoneEnd - zoneStart, height() / 2, m_zoneColor);
+
+ if (r.top() < 9) {