kokkoras wrote:Hi,
There is an issue with the function TGraphNode.GetTextRect: TRect;
When zooming, at certain zoom percentages the text of a node is truncated and part of it is replaced by dots (...). I think it is related to some decimal values convetred to integers. I have quick-fixed this by setting Result.Right := MaxTextRect.Right+2; instead of conditionally calculating it.
....
SetMapMode(MemDC, MM_ANISOTROPIC);
SetWindowExtEx(MemDC, 100, 100, nil);
SetViewPortExtEx(MemDC, Zoom, Zoom, nil);
...
function TGraphNode.GetTextRect: TRect;
if Result.Right > MaxTextRect.Right then
Result.Right := MaxTextRect.Right;
Result.Right := MaxTextRect.Right+1;
lbc wrote:Hello
As far as the text issue it seems to me that setting the Text Margin to 0 can help a bit in keeping the same "text proportions" at all zooming states
HTH
sergisan wrote:kokkoras,
are you planning to post the code ?
Serg...
procedure TSimpleGraph.ToggleNodesAt(const Rect: TRect; KeepOld: Boolean);
var
GraphObject: TGraphObject;
I: Integer;
R: TRect;
myLinkRect: TRect; //FOTIS: additional var
begin
if not KeepOld then
SelectedObjects.Clear;
for I := Objects.Count - 1 downto 0 do
begin
GraphObject := Objects[I];
// FOTIS: handle the horizontal or vertical link anomaly due to IntersectRect
if GraphObject.IsLink then begin
myLinkRect:= GraphObject.BoundsRect;
myLinkRect.Top:= myLinkRect.Top-1;
myLinkRect.Bottom:= myLinkRect.Bottom+1;
myLinkRect.Left:= myLinkRect.Left-1;
myLinkRect.Right:= myLinkRect.Right+1;
if IntersectRect(R, Rect, myLinkRect) then
GraphObject.Selected := not GraphObject.Selected;
end;
//FOTIS: handle non-Link objects
if ((not GraphObject.IsLink) and (IntersectRect(R, Rect, TGraphNode(GraphObject).BoundsRect)) )
then
GraphObject.Selected := not GraphObject.Selected;
end;
end;
kokkoras wrote:
It's true because it gives the same result: more space for the text to fit. But the drawback is that Margin is for another usage.
fotis
kokkoras wrote:The fact that it happens at certain zoom states supports this. Anyway, I think adding a pixel width is not a big deal unless the context of use requires precision.
fotis.
Hello
i agreee with you
by the way have you had the chance to test with a lot of fonts, sizes, text styles etc. if your fix eliminate definitely that text issue at any zoom state?
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 2 guests