Skip to content

cwProgress Rendering #33

@jpbro

Description

@jpbro

Hi Olaf,

When the cwProgressBar is in marquee mode the rendering of the marquee portion appears to be "off" a bit. See below:

image

I've traced this to the DrawUsedArea method:

Private Sub DrawUsedArea(CC As cCairoContext)
  Dim ScaledValue As Double, StartX As Double

  CC.SetLineWidth 0
  ScaledValue = ((mValue - mMin) / (mMax - mMin)) * (mInternalW - 2.5)

  If mStyle <> pg_Standard Then
    StartX = ScaledValue - (mInternalW * MarqueeWidthPct)
  End If

  Cairo.Theme.DrawTo CC, W, thmTypeProgressFace, thmStateSolidColor, StartX, 0, ScaledValue - StartX, mInternalH, mBorderRadius
End Sub

In particular the StartX value is being calculated a -70 on my machine where ScaledValue = 0, mInternalW = 280, and MarqueeWidthPct = 0.25.

I'm not 100% sure what the goal of the code is there, leaving StartX at 0 seems to render "correctly" IMO:

image

Is there a good reason for the StartX = ScaledValue - (mInternalW * MarqueeWidthPct) line but the calculation is off for some displays/environments, or should we delete the whole If mStyle <> pg_Standard block?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions