[Bug-1176, 2463] View Canvas: useDefaultX properties are swapped

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.

  1. I noticed the same thing and thought I had opened a bug for it, but I can’t find it for the life of me at this time. I’ll open an internal ticket now.

  2. width, height, left, right, top, and bottom are all documented as being “numeric” value types, because they are all cast to pixel values.

  3. See 2.

So if I wanted the element to be 20% of the canvas, how would I do that?

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.

How could I do this with the parent not fixed?

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.

1 Like

We just installed 8.1.7 to resolve this exact issue, and it seems to still be prevalent in 8.1.7.

It was probably pushed back to 8.1.8 as they had to do an early release of 8.1.7 to fix an issue caused in 8.1.6.

Oh bummer. Any rough time frame on 8.1.8?

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.

8.1.8 is scheduled for early August.

1 Like