[L2Ork-dev] Excalibur Bug
Jonathan Wilkes
jon.w.wilkes at gmail.com
Sat Jun 13 01:11:35 EDT 2020
Okay, I've got an initial non-quirksmode fix:
diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index a24a6f71..dc631963 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -5774,8 +5774,8 @@ function canvas_params(nw_win)
// the scrollbars from appearing. Here, we just subtract 4 from both
// of them. This could lead to some problems with event handlers but I
// haven't had a problem with it yet.
- min_width = nw_win.window.innerWidth - 4;
- min_height = nw_win.window.innerHeight - 4;
+ min_width = nw_win.window.innerWidth;
+ min_height = nw_win.window.innerHeight;
// Since we don't do any transformations on the patchsvg,
// let's try just using ints for the height/width/viewBox
// to keep things simple.
@@ -5803,6 +5803,9 @@ function do_getscroll(cid) {
mw: min_width, mh: min_height } = canvas_params(nw_win);
if (width < min_width) {
width = min_width;
+ nw_win.window.document.body.style.overflowX = "hidden";
+ } else {
+ nw_win.window.document.body.style.overflowX = "visible";
}
// If the svg extends beyond the viewport, it might be nice to pad
// both the height/width and the x/y coords so that there is extra
@@ -5811,6 +5814,9 @@ function do_getscroll(cid) {
// edges.
if (height < min_height) {
height = min_height;
+ nw_win.window.document.body.style.overflowY = "hidden";
+ } else{
+ nw_win.window.document.body.style.overflowY = "visible";
}
configure_item(svg_elem, {
viewBox: [x, y, width, height].join(" "),
So opening bang-help.pd I get no scrollbars under Linux. Works in
different zoom levels, too.
One unrelated bug I just noticed-- if you select a [cnv] with other
multiple objects, the little
anchor square appears for resizing the [cnv]. That square is in the
bottom right-hand corner
of the [cnv] so it will cause the bbox for the SVG to be bigger than
it should when you have,
say, the footer of bang-help.pd selected.
-Jonathan
On Sat, Jun 13, 2020 at 12:49 AM Jonathan Wilkes <jon.w.wilkes at gmail.com> wrote:
>
> Getting closer--
>
> You should get perfect, predictable scrollbar behavior by removing the
> following line from pd_canvas.js:
>
> <!DOCTYPE html>
>
> Of course you'd have to also remove all the kludges currently in the
> resizing algo.
>
> By removing this line, all browsers will render the page in "quirks
> mode." Quirks mode uses some
> old compatibility rendering algos that pre-date HTML5. Older web pages
> don't have the !DOCTYPE
> directive and therefore will be displayed properly.
>
> Now the problem is this: given the various quirksmode features, I have
> no idea which of them is
> responsible for fixing this issue. And while it must be possible that
> non-quirks mode can achieve this
> same obvious, unsurprising behavior I don't know what incantation of
> CSS soup is required to
> get it.
>
> Does anyone know an HTML5 guru who can recite for me the correct CSS
> incantation here?
>
> If not I may have just figured out a workaround...
>
> -Jonathan
More information about the L2Ork-dev
mailing list