Forum > TAChart

TAChart + TChartGUIConnectorBGRA issue

(1/2) > >>

ChristianH:
Hi,

i have a problem with the latest official Lazarus build in combination with TAChart and BGRA. The legends are rendered horribly wrong.

The reason is the DrawFontBackground:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TBGRACanvas.TextOut(X, Y: Integer; const Text: String);var size: TSize;    c,s: single;begin  ApplyFont;  if DrawFontBackground then  begin    size := TextExtent(Text);    c := cos(Font.Orientation*Pi/1800);    s := -sin(Font.Orientation*Pi/1800);    PolygonF([PointF(X,Y),PointF(X+c*size.cx,Y+s*size.cx),              PointF(X+c*size.cx-s*size.cy,Y+s*size.cx+c*size.cy),              PointF(X-s*size.cy,Y+c*size.cy)],False,True);  end;  if Font.Texture <> nil then    FBitmap.TextOut(x,y,Text,Font.Texture) else    FBitmap.TextOut(x,y,Text,Font.BGRAColor);end;    
It is enabled by default and looks like this in my case like in the attached image. It was working in older builds, so I wonder is this a bug?

Christian

lainz:

--- Quote from: ChristianH on March 07, 2023, 08:49:24 pm ---Hi,

i have a problem with the latest official Lazarus build in combination with TAChart and BGRA. The legends are rendered horribly wrong.

The reason is the DrawFontBackground:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TBGRACanvas.TextOut(X, Y: Integer; const Text: String);var size: TSize;    c,s: single;begin  ApplyFont;  if DrawFontBackground then  begin    size := TextExtent(Text);    c := cos(Font.Orientation*Pi/1800);    s := -sin(Font.Orientation*Pi/1800);    PolygonF([PointF(X,Y),PointF(X+c*size.cx,Y+s*size.cx),              PointF(X+c*size.cx-s*size.cy,Y+s*size.cx+c*size.cy),              PointF(X-s*size.cy,Y+c*size.cy)],False,True);  end;  if Font.Texture <> nil then    FBitmap.TextOut(x,y,Text,Font.Texture) else    FBitmap.TextOut(x,y,Text,Font.BGRAColor);end;    
It is enabled by default and looks like this in my case like in the attached image. It was working in older builds, so I wonder is this a bug?

Christian

--- End quote ---

Please report in BGRABitmap at GitHub:
https://github.com/bgrabitmap/bgrabitmap/issues/new

wp:
No, this is not a BGRABitmap issue. I used the same version (v11.3.1) with both Laz-main and withLaz-2.0.8 and get the correct legend text in the old Laz version, but not in the current version. I think this issue is due to some changes made by myself some time ago to make TAChart colors more compatible with dark mode.

wp:
Fixed in Laz/main.

ChristianH:
Wow, this was quick. Thanks. I found also another problem I guess. This time with aggpas.
If I use this GUIConnector the output is completely black. I attached a test binary. I did not found time to debug it yet, but I will probably do so tomorrow.

Christian

Navigation

[0] Message Index

[#] Next page

Go to full version