ProgressWidget: Simplify painting logic.

* Use paintRect and plain colors instead of lightenRect and a weird
  dimming factor.
* Update call sites to the new API
* Handle FP maths properly (i.e., floor coordinates & ceil dimensions at
  the latest possible time).
* Fix border handling in the fill bar (make sure we actually honor it
  when computin the x position, and that we won't overflow into it when
  computing the width).
* Update docs
This commit is contained in:
NiLuJe
2021-10-21 19:40:04 +02:00
parent b996b8282f
commit 942ea70235
2 changed files with 66 additions and 54 deletions

View File

@@ -1210,7 +1210,7 @@ function ReaderRolling:showEngineProgress(percent)
self.engine_progress_widget = ProgressWidget:new{
width = w,
height = h,
rectdim = 1, -- we need pure B&W for refreshFast
fillcolor = Blitbuffer.COLOR_BLACK, -- we need pure B&W for refreshFast
percentage = percent,
margin_h = 0,
margin_v = 0,