I’ve been trying to use ViewCanvas the last few days and I’m finding a number of issues that I would assume are bugs.
Bug 1: The useDefaultViewWidth / Height options seem to be swapped. When I toggle the useDefaultViewWidth, it changes the height and when I toggle the useDefaultViewHeight, it changes the width.
Bug 2: When I try to put a percentage in for the width or height, it doesn’t work. It just shrinks it down to it’s smallest possible size fitting it’s content.
Bug 3: I’m guessing this is related to bug 2, but when I try to use the style minWidth, I’m getting the same problem. If I say minWidth: 500, it works as expected, but with minWidth: 50%, it breaks. This is true with the styles for the individual instances and the defaultStyle.
The View Canvas would have to be in a Coordinate Container (which must be in “fixed” mode).
Then you’d bind the width of the instance against the width of the View Canvas.
In the following screenshot, you can see that I’ve set my View Canvas to be 400px wide. I then bind the width of my instance against the width of my View Canvas and divide that value by 5. Note that I’ve turned off useDefaultHeight (because it’s improperly swapped with useDefaultWidth at this time. If you specify to sue the defaults, then the default values will override any value you set for width/height of the instance.
Also, while percentages don’t work with width and height, they work just fine with top, left, bottom, and right. It makes no since that it wouldn’t work for width and height too. If this isn’t a bug, it’s an oversight.
The issue with useDefaultHeight/Width being swapped has been resolved in 8.1.7 8.1.8 (due to 8.1.7 being 8.1.6 with an emergency rollback).
I also located an internal ticket to allow for percentage values for positional properties. That ticket has NOT been addressed yet, but I have linked this thread to that issue so that we can update here when the work is completed.
Exactly that. Please see this post: What happened to version 8.1.6 LTS? It appears to be gone! I had updated this thread as soon as the fix was put in place, but that version of code wound up becoming 8.1.8 after my post due to the “emergency” release of 8.1.6 + one rollback. I will update the post which declared the fix version.