ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Layer alignment broken?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
whisper1980 Posted - Dec 07 2019 : 17:27:56
I believe layer alignment worked fine in 8.7.0 because that is where I first added layer alignment in my app.

I just now tried it after updating to 8.7.6, and it does not work at all. For example, selecting a single rectangle layer and clicking to align left causes the rectangle pos to shift basically out of bounds:

Using these lines of code:
ImageEnView1.LayersRepositionAll(IELayer_Pos_Left, 0, true, false, false);
ImageEnView1.Update();

The rectangle goes from
pos: 701,1068 size: 525x274 to
pos: 2147483636,1068 size 525x274

I also do not see the rectangle anymore, just the dotted sizing lines.

Similar things occur for the other alignment options, for example:
Align top:
ImageEnView1.LayersRepositionAll(0, IELayer_Pos_Top, true, false, false);
From 709,1159
to: 709,2147483636

None of these work: left, top, right, bottom, center vert, center horz.

I think I see the problem... (I have not tested this theory yet)

In LayersRepositionAll you are assigning the new pos directly to PosXD and PosYD instead of PosX, PosY. In 8.7.0, when setting PosX IELayer_Pos_Left is checked for and sets PosXD to 0 but in setting PosXD directly in LayersRepositionAll that check is missing, so it ends up assigning IELayer_Pos_Left as the new actual X pos instead of 0.

Maybe something there?

Eric
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 05 2020 : 23:11:30
Thanks, this is fixed for 8.7.7

Nigel
Xequte Software
www.imageen.com
whisper1980 Posted - Dec 09 2019 : 13:36:23
As a quick and dirty fix until you return in case others run into this, I made the following change to TImageEnView.LayersRepositionAll:

From:
aLayer.PosXD := newPosX;
aLayer.PosYD := newPosY;
To:
aLayer.PosX := Trunc(newPosX);
aLayer.PosY := Trunc(newPosY);


Eric
xequte Posted - Dec 09 2019 : 03:12:55
Thanks for the investigation, Eric,

I'll get a fix in the next update.

Nigel
Xequte Software
www.imageen.com
whisper1980 Posted - Dec 08 2019 : 18:25:41
That option makes no difference. Tracing the code seems to show that replacing those constants like IELayer_Pos_Top is not being replaced when setting PoxXD or PosYD directly like setting PosX/PosY does. Setting PosX eventually calls SetPosXD, but only after those constants have been looked at, conditionally setting the pos to the passed in value or to 0, i.e. if v < IELayer_Pos_Left then SetPosXD(v) else SetPosXD(0), but SetPosXD itself does not have this if statement and LayersRepositionAll now uses SetPosXD not SetPosX.



Eric
xequte Posted - Dec 08 2019 : 10:52:05
Hi Eric

I'll need to investigate this when I'm back in the office in late December. Does changing loDynamicCanvas of ImageEnView1.LayerOptions make any difference?



Nigel
Xequte Software
www.imageen.com