Conversation
|
This looks good to me, but here's an edge case we haven't handled. Suppose there are two artboards with a |
|
Here is a (currently failing) test that illustrates what I'm talking about: it('height-limited, "fixed", two artboards with same width, neither overflow height limit', function () {
var data = [
// two abs have same width but neither overflows -> pick the tallest one
{id: 0, min_width: 300, aspect_ratio: 1},
{id: 1, min_width: 300, aspect_ratio: 2}
];
var opts = {responsiveness: 'fixed', responsive_height_limit: 90};
var containerWidth = 400;
var windowHeight = 1000; // limit is 900px
var expect = {
id: 0, min_width: 300, aspect_ratio: 1};
var result = findVisibleArtboard(data, containerWidth, windowHeight, opts);
assert.deepEqual(result, expect);
}); |
|
After talking with Archie, it looks like we'll need to change the behavior of our updated resizer function a bit. We need be able to display multiple artboards at the same time if they have the same minimum width, and they should be in the same order as the original artboards in the Artboards palette of the AI document. |
Adds two settings,
use_responsive_heightandresponsive_height_limit. Ifuse_responsive_heightisyes, then the height of the artboard will not exceedresponsive_height_limitpercent of the window height. If every artboard exceeds this height, ai2html will display the smallest artboard (by width).Note that
responsive_height_limitmust be between 0 and 100 inclusive.