Closed jfudickar closed 1 year ago
Please attach the SVG file...
It must be attached somehow, because I dragged it in. Try the right mouse click on the big image and save as.
I've notice that the problems are in those 4 lines: adding an 'X' instead of three spaces shows the X with correct background color...
`
` Maybe an incorrect use of background text color for spaces, in Image32 SVG Library of Angus: https://github.com/AngusJohnson/Image32
Will you raise a ticket there? I can't work with the X :-)
Hi Jens. I can confirm there is a bug in Image32's SVG reader, but I can't see an easy fix. While I've only had a quick look so far, the issue seems to be related to getting the correct bounds of the floodfill filter element.
Hi Angus, I have not a real problem with it. The delphi implementation is only a "nice to have" of my json2puml project. Most of the people will work with the svg file directly. But I wanted to mention it :-)
Here's a 'quick and dirty' solution ...
In TShapeElement.Draw() in Img32.SVG.Reader @ line ~2100
//get special effects bounds
if Assigned(clipPathEl) then
begin
....
end
else if Assigned(maskEl) then
begin
....
end else
begin
clipRec := drawDat.bounds;
// add this //////////////////
if clipRec.IsEmpty and
(drawDat.fontInfo.textLength > 0) and
(self is TSubtextElement) then
begin
clipRec.Left := fParent.elRectWH.left.rawVal;
clipRec.Bottom := fParent.elRectWH.top.rawVal;
clipRec.Right := clipRec.Left + drawDat.fontInfo.textLength;
clipRec.Top := clipRec.Bottom - drawDat.fontInfo.size;
end;
//////////////////////////////
Yes seems to fix it. Nice. And thanks!!!
After upgrading to v4 the problem is back :-(
Adding the line fixes it again !
Oh, sorry, but I've aligned Image32 source code of @AngusJohnson retrieved from His Gitub repo, probably it was not updated...
I've just updated the Image32 repository and the fix above has been included.
Have a look at this SVG file (generated from plantuml). In the legend at the end there are empty coloured rectangles which are not drawn in delphi : but drawn when showing the file in the edge browser:
Regards Jens