| 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. |
| Code: |
|
.... SetMapMode(MemDC, MM_ANISOTROPIC); SetWindowExtEx(MemDC, 100, 100, nil); SetViewPortExtEx(MemDC, Zoom, Zoom, nil); ... |
| Code: |
| function TGraphNode.GetTextRect: TRect; |
| Code: |
| if Result.Right > MaxTextRect.Right then
Result.Right := MaxTextRect.Right; |
| Code: |
| 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... |
| Code: |
|
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. |
| Quote: |
| 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? |
| lbc wrote: |
| well, thank you
just an idea: ...... |
| Kambiz wrote: |
| kokkoras,
Finally I could reproduce the bug, and I'm trying to fix it. |
| Kambiz wrote: |
|
Please check out the following link for this bug: http://www.delphiarea.com/forum/viewtopic.php?t=527 Cheers |
output generated using printer-friendly topic mod. All times are GMT