Icon View Incident Report

Serious Serious
Reported By: Bruno Larochelle
Reported On: 1/9/2017
For: Version 2.05 Build 4
# 4476 TPaint Canvas Element Not Resetting Font Size Properly when Control Resizes

I have an issue on the project I am working on where font sizes seem to go to default size when I resize and redraw text to the screen. I created a new project to make sure it wasn't something else I was doing.

This project has 2 panels top/bottom with a sizer inbetween. The splitter correctly resizes both panels.

The following is the code I have.

When the application starts a 14 is drawn at the correct size. The moment I use the sizer the 14 immediately gets smaller (and I believe the font changes but it is hard to tell). It is still writing 14 suggesting it is still set to a font size of 14 but it draws it as the default font. If I instead put drawText; in the paintSize event it does not draw anything at all.

procedure TForm1.Form1Create(Sender: TObject);
  pntMain.Canvas.Font.Name := 'Arial';
  pntMain.Canvas.Font.Size := 14;

procedure TForm1.drawText;
  pntMain.Canvas.FillText(intToStr(pntMain.Canvas.Font.Size), 100, 100);

procedure TForm1.BasicPanel1Size(Sender: TObject);

Comments Comments
The canvas element's font size was not getting reset properly when the canvas itself was reset due to the size change.

Resolution Resolution
Fixed Problem on 1/9/2017 in version 2.06 build 1

Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial