Annotation Editor : ZOrder issues

Discussions about annotation support.
Post Reply
User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Annotation Editor : ZOrder issues

Post by AgfaDev » Mon Nov 18, 2013 10:45 am

GdPicture .NET 10.1.0

There are several issues in the Annotation Editor concerning the Z-order management.

1) When changing the z-order by code, the editor is not refreshed when it is open and displaying the attributes of
the changed annotation object.
Calling Editor.Refresh( ) does not update the current attribute values. The only way to refresh the editor is by clicking outside the object and click back on the annotation to refresh the value.

2) You can set a z-order value to an object in the editor, but the other annotations on the image are not updated correctly.
For instance, say you have two annotations which are initially having:

Object A -> z-order = 0
Object B -> z-order = 1

Now manually change the z-order of object B from 1 to 0.
Now check the z-order of object A (which should be 1). But this is the case:

Object A -> z-order = 0
Object B -> z-order = 0

You have to manually change object A z-order to 1.

The z-order must be automatically set to all objects when the order is changed manually or by code.

3) Visually the z-order is incorrect when changing it manually for just one object.
When multiple objects have the same z-order value (see case 2) it does not reflect the correct visuals.

See screenshot.
zorder.png
There are 3 objects (arrows). The yellow is visually on bottom which has z-order=0
The black object has also z-order=0 (see value in the editor) but it is not visually at the bottom.
It is in fact on z-order=1. The blue one is on top and has the correct z-order.

So, manually changing the z-order means you have to change it for all objects, otherwise you get the results as in the screenshot.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Annotation Editor : ZOrder issues

Post by Loïc » Thu Nov 21, 2013 6:10 pm

Hello,
You have to manually change object A z-order to 1.
This is the expected behavior. The zorder is not intended to be a unique value in a collection.
3) Visually the z-order is incorrect when changing it manually for just one object.
When multiple objects have the same z-order value (see case 2) it does not reflect the correct visuals.
I don't understand what the problem is. That said, in the very latest minor release we've fixed a rendering issue: When x annotation has the same zorder, the latest in the collection be on top of all others.

With best regards,

Loïc

User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Re: Annotation Editor : ZOrder issues

Post by AgfaDev » Thu Nov 21, 2013 10:24 pm

Oh, I did not know that this is intended behavior.

But when I think of z-order, it is the visual layering of the objects in the z-axis and no two objects can have the same z position visually.
There is always an object above or below another object (like a pile of sheets).
When I look at an object which is visually below another, the z-order is lower than the one which is above.
But in the editor this is not the case. They can have the same value, which is visually not corresponding and conceptually incorrect.

Besides that, it is not very user friendly. When there are multiple objects (say 10) on screen and you want to place one at the bottom most position by
setting the value to 0 (zero) it could visually be still not the lowest one. Then you have to click the other objects one by one to find the object which has also
value 0 and change that to, well what value? If you want to set it to 1, then you will have to find the other object which also has value 1 and change that to, well a value which probably will be in use by yet another object. And so on.
So by changing the value of one object you have to manually change them all to be correctly displayed.

The position in the collection-list is not a very valuable way to determine the z-order when values are the same.

I would expect, but that is my case, that z-order is unique in the collection, as it is visually. So changing one value would affect all other values at the same time.
The z-order shifts throughout the list.

One of my enhancement request I posted is a "bring to front" and "send to back" feature for objects.

Now I have implemented this by setting one object to z-order = 0 and loop through all objects and increase their z-order by one for all those objects which had a lower z-order value. This is a bit complex for such a simple action, but that is only caused by the z-orders not being unique in the list.

User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Re: Annotation Editor : ZOrder issues

Post by AgfaDev » Wed Nov 27, 2013 9:03 am

We have found another z-order issue.

When for instance there are 2 annotation objects which are on top of eachother, you are unable to select the "top"one when the "bottom" one is selected.

A screenshot explains this better:
AnnotationClickIssue.png
See that the yellow object is at the bottom and is selected (zorder=0)
The pink object is clearly at the top (zorder=1)

Now try to click the pink object (and move it) when the yellow object is selected. When you click at the spot where the text of the pink object is displayed, you can not select the object.
You really have to click outside the bounding rectangle area of the yellow object to be able to select the pink one.
So only by clicking the lower right of the pink object it is selected.

This is a real problem when the objects are really on top of each other. You can never select the top object when the bottom object is selected.

A workaround is to click on the canvas first and then on the top object.

Should the top object not be the one which will get the click event when the click position is within the objects boundary?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Annotation Editor : ZOrder issues

Post by Loïc » Mon Dec 02, 2013 12:51 pm

Hello,

Thank you for the report. This behavior will be fixed for the next minor release.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest