Commits

Aleš Erjavec committed 5fd8d04

Ensure the NodeItem shows a visual progress indicator even at 0% progress.

  • Participants
  • Parent commits ac6743b

Comments (0)

Files changed (1)

Orange/OrangeCanvas/canvas/items/nodeitem.py

             # Prevent the default bounding rect selection indicator.
             option.state = option.state ^ QStyle.State_Selected
         GraphicsPathObject.paint(self, painter, option, widget)
-
         if self.__progress >= 0:
             # Draw the progress meter over the shape.
             # Set the clip to shape so the meter does not overflow the shape.
             painter.save()
             painter.setPen(pen)
             painter.setRenderHints(QPainter.Antialiasing)
-            span = int(self.__progress * 57.60)
+            span = max(1, int(self.__progress * 57.60))
             painter.drawArc(self.__shapeRect, 90 * 16, -span)
             painter.restore()
 
         Update the title text item.
         """
         title_safe = escape(self.title())
-        if self.progress() > 0:
+        if self.progress() >= 0:
             text = '<div align="center">%s<br/>%i%%</div>' % \
                    (title_safe, int(self.progress()))
         else: