TSimpleGraph Issues (and wish list)
Posted: August 3rd, 2006, 11:17 pm
Well, finally I found some time to play with TSG 2.61. A list of "issues" follows with some suggestions/requests. I will keep on adding material to this post to have a to-do list to consider in the ...unknown future.
1. The node markers should be drawn in fixed size. The current size (at 100% zoom) is ok. The reason is that at high zoom values the markers occupy too much space on the canvas (not to mention that it is possible to be taken for nodes).
update: tested - impossible to produce consistent appearence
2. The double line used to draw objects when dragging them, makes exact positioning difficult, particularly when snap_to_grid is off. The old way was more precise.
3. Node creation by dragging on the canvas is problematic. First, it forces a NW to SE movement. If I try to violate this (say, by moving SE to NW beyond the top left corner of the node) the mouse moves but the node stays still. As a result the mouse "loses" the corner of the node.
4. The grid should not be drawn when GridSize*Zoom%<5 no matter what the showGrid flag is set to.
Update: Done! add "if (Zoom/100)*GridSize > 5 then" in TSimpleGraph.Paint, after "try".
5. A link "modification mode" will make life easier regarding the alt, ctrl, shift and mouse handling. We get into that mode somehow and then follow the current handling.
6. Some times the zoom behaviour is odd. Part of it is because of the fixed (0,0) of the canvas. This is understandable.
Update 1: We should consider the possibility of having (0,0) at the center of the canvas (like in ACAD), as long as the calculations do not become a nightmare.
Update 2: Zoom behaviour suggestion: Letting aside the effects caused by the (0,0) point, I will describe a zoom behaviour. The user somehow (toolbar button or Ctrl+Space comes into mind) gets into zoom mode, that is, SG accepts only zoom commands. In the following, I use the FixedPoint term to refer to the point of the canvas that remains still after zooming.
a) keypad + or -
increase or decrease zoom by a factor of 2
Fixed Point: center of canvas
b) mouse click or Shift + mouse click
increase or decrease zoom by a factor of 2
Fixed Point: pointer position
c) selection rect with mouse
WR:= CanvasWidth/RectWidth
HR:= CanvasHeight/RectHeight
Zoom:= Round(Zoom * min(Wr,HR))
Fixed Point: not applicable
d) wheel mouse zoom
increase or decrease zoom by 10 units (or better by WheelZoomStep units - see suggestion 7)
Fixed Point: pointer position
e) useful zoom states
1) Zoom 100%: directly set,
Fixed Point: center of canvas
2) Zoom Selection: like (c) based on
the bounds rect of the selected
3) zoom all: like (c) based on the
bounds rect of all objects
So, it seems that the TGraphZoomOrigin is not required. Also the scroll commands inside the ChangeZoom function should be reconsidered because they produce flicker.
1. The node markers should be drawn in fixed size. The current size (at 100% zoom) is ok. The reason is that at high zoom values the markers occupy too much space on the canvas (not to mention that it is possible to be taken for nodes).
update: tested - impossible to produce consistent appearence
2. The double line used to draw objects when dragging them, makes exact positioning difficult, particularly when snap_to_grid is off. The old way was more precise.
3. Node creation by dragging on the canvas is problematic. First, it forces a NW to SE movement. If I try to violate this (say, by moving SE to NW beyond the top left corner of the node) the mouse moves but the node stays still. As a result the mouse "loses" the corner of the node.
4. The grid should not be drawn when GridSize*Zoom%<5 no matter what the showGrid flag is set to.
Update: Done! add "if (Zoom/100)*GridSize > 5 then" in TSimpleGraph.Paint, after "try".
5. A link "modification mode" will make life easier regarding the alt, ctrl, shift and mouse handling. We get into that mode somehow and then follow the current handling.
6. Some times the zoom behaviour is odd. Part of it is because of the fixed (0,0) of the canvas. This is understandable.
Update 1: We should consider the possibility of having (0,0) at the center of the canvas (like in ACAD), as long as the calculations do not become a nightmare.
Update 2: Zoom behaviour suggestion: Letting aside the effects caused by the (0,0) point, I will describe a zoom behaviour. The user somehow (toolbar button or Ctrl+Space comes into mind) gets into zoom mode, that is, SG accepts only zoom commands. In the following, I use the FixedPoint term to refer to the point of the canvas that remains still after zooming.
a) keypad + or -
increase or decrease zoom by a factor of 2
Fixed Point: center of canvas
b) mouse click or Shift + mouse click
increase or decrease zoom by a factor of 2
Fixed Point: pointer position
c) selection rect with mouse
WR:= CanvasWidth/RectWidth
HR:= CanvasHeight/RectHeight
Zoom:= Round(Zoom * min(Wr,HR))
Fixed Point: not applicable
d) wheel mouse zoom
increase or decrease zoom by 10 units (or better by WheelZoomStep units - see suggestion 7)
Fixed Point: pointer position
e) useful zoom states
1) Zoom 100%: directly set,
Fixed Point: center of canvas
2) Zoom Selection: like (c) based on
the bounds rect of the selected
3) zoom all: like (c) based on the
bounds rect of all objects
So, it seems that the TGraphZoomOrigin is not required. Also the scroll commands inside the ChangeZoom function should be reconsidered because they produce flicker.