Thread: Anchoring issue/bug
-
March 22nd, 2023, 18:22 #1
Anchoring issue/bug
I have two controls set up like this:
Code:<genericcontrol name="columnanchor"> <!-- <anchored height="0"> <top offset="40" /> <left offset="30" /> <right offset="-30" /> </anchored> --> <anchored position="insidetop" offset="-30,40" /> <disabled /> <invisible /> </genericcontrol> <stringcontrol name="instructions_label"> <font>sheetlabel</font> <nodrag /> <readonly /> <anchored height="40"> <top parent="columnanchor" anchor="bottom" relation="relative" offset="7" /> <left parent="columnanchor" anchor="left" /> <right anchor="right" /> </anchored> <multilinespacing>20</multilinespacing> <static textres="pc_label_parse_instructions" /> </stringcontrol>
Obviously I could just directly set the offset= on the <right> element to a static value, which seems to work fine. I'm just wondering why the approach above isn't working. I feel like I'm missing something obvious.Last edited by darrenan; March 22nd, 2023 at 18:25.
-
March 23rd, 2023, 10:36 #2
Would position="below" inherit left and right?
-
March 25th, 2023, 17:42 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,282
It's because your columnanchor does not have a width. In the other examples in the built-in rulesets, the column anchor is usually tied to an offset from the left/right edges of the parent window, which gives it an implied dynamic width based on the size of the window.
In your example above, your columnanchor has a top/left anchor, but no right/bottom anchors, nor width/height specifiers. This means that it will default to zero height/width.
Regards,
JPGFG Wish List - https://fgapp.idea.informer.com/
-
March 27th, 2023, 15:54 #4
I thought "insidetop" had implied left and right anchors? That's what the anchors diagram seems to suggest. And yes, I should have put height 0 on that version of the anchor.
Also, the commented-out version did have all those anchors and I was seeing the same issue.Last edited by darrenan; March 27th, 2023 at 16:01.
-
March 27th, 2023, 16:07 #5
"below" would put it off the bottom of the window since it's not attached to a control, but the containing window. I believe insidetop is the appropriate anchor based on the diagram.
-
March 27th, 2023, 16:09 #6
Ok, the actual problem was that I had <invisible/> on columnanchor. I guess you can't anchor to invisible controls. Once I removed that it started working just fine.
-
March 27th, 2023, 16:11 #7
Invisible eliminates it as an anchoring target.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Idea Informer
-
March 27th, 2023, 16:53 #8
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,282
You are correct on the "insidetop", so sorry for the red herring. Controls must be visible to be anchored to, as you've found.
Regards,
JPGFG Wish List - https://fgapp.idea.informer.com/
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks