[Gambas-bugtracker] Bug #2385: Gambas IDE code text overwriting itself

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sun Oct 24 20:42:40 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2385&from=L21haW4-

Comment #6 by Jason JORDAN:

I don't know if this helps, but my Gambas code, takes the desktop image, 
displays weather from an RSS feed - saves it on far right of screen.

Screen-shots attached, 1 minute apart - same data, same code.

Sometimes it wraps - almost as if the "Paint.DrawRichText()" function believes the desktop 
display width is smaller, I put some logging in to see if anything stood out - nothing strange.

Same SQL data through same code, sometimes wraps early - other times shows normally.

code used here...
Private Function drawWeatherData(p As Picture, weatherText As String, index As Integer) As Picture

Dim fontSize As Integer = 12

  Paint.Begin(p)
  Paint.Font.Size = fontSize
  Dim r As RectF = Paint.TextSize(weatherText)
  Paint.End
  Dim tW As Float = r.Width
  Dim tH As Float = r.Height

  Dim pW As Float = tW + 5 '200
  Dim pH As Float = tH + 5 '25
  Dim pX As Float = Screen.Width - pW - 5
  Dim pY As Float = Screen.Height - pH - 35

  pX = pX - pictureRightTextBezelSize
  pY = pY - ((th + 9) * index)

  Paint.Begin(p)
  Paint.FillRect(pX, pY, pW, pH, Color.RGB(35, 38, 39))
  Paint.Font.Size = fontSize
  If index = 3 Then
    Paint.DrawRichText("<font color=\"#FFFFFF\">" & Trim(weatherText), pX + 5, pY + 15) '<<<<<<<<< THIS Draw sometimes wraps early
  Else
    Paint.DrawRichText("<font color=\"#AAAAAA\">" & Trim(weatherText), pX + 5, pY + 15) '<<<<<<<<< THIS Draw sometimes wraps early
  Endif
  Paint.End

  Return p

End

...I don't know if this helps?

----------------------------------------------------------------------------

Attachment: Screenshot at 2021-10-24 19-33-22.png

Attachment: Screenshot at 2021-10-24 19-34-20.png

Jason JORDAN changed the state of the bug to: Accepted.




More information about the Bugtracker mailing list