Commit 638a27cf authored by Leon Arnott's avatar Leon Arnott
Browse files

Fixed a bug where (text-rotate-x:), (text-rotate-y:) and (text-rotate:)...

Fixed a bug where (text-rotate-x:), (text-rotate-y:) and (text-rotate:) couldn't be added together to produce a combined rotation.

Also made the link bugfix in the previous commit apply to (link-reveal-goto:).
parent 7766c886e09a
......@@ -22,6 +22,7 @@ Documentation is at http://twine2.neocities.org/. See below for compilation inst
* Fixed a bug where giving a blank string as the Cancel button's label to `(prompt:)` or `(confirm:)` wouldn't cause the Cancel button to disappear.
* Fixed a bug where `(link-rerun:)` behaved like `(link-repeat:)` when it was enchanted by `(enchant:)`.
* Fixed a bug where error messages would sometimes refer to temp variables named "all" as "all values of the temporary variables". The same applies to "any", "start", and "end".
* Fixed a bug where `(text-rotate-x:)`, `(text-rotate-y:)` and `(text-rotate:)` couldn't be added together to produce a combined rotation.
* Fixed a long-standing bug where clicking passage links would activate `(click:?Page)` macros in the arrival passage.
* Fixed a bug where hidden hooks and the `(hidden:)` changer would suppress the effects of `(hook:)`.
* Fixed a bug where `...array-type` parameters to custom macros would unwittingly "flatten" the passed-in arrays, joining them all together.
......
......@@ -591,7 +591,8 @@ define(['jquery', 'utils', 'state', 'internaltypes/varref', 'internaltypes/twine
Enchantments.panelRows.empty();
Enchantments.tabUpdate(0);
if (State.passage) {
Source.panelRows.text(Passages.get(State.passage).get('source'));
const p = Passages.get(State.passage);
p && Source.panelRows.text(p.get('source'));
}
}
/*
......
......@@ -183,21 +183,23 @@ define(['jquery', 'utils', 'renderer', 'datatypes/hookset'], ($, {assertOnlyHas,
*/
keys(style).forEach(k => {
const v = style[k];
a[+(typeof v === "function")][k] = v;
a[+(typeof v === "function")].push({[k]:v});
});
return a;
}, [{},{}]);
}, [[],[]]);
/*
Now, the independent CSS can be applied immediately.
*/
elem.css(independent);
independent.forEach(e => elem.css(e));
/*
If the user has complicated story CSS, it's not possible
to determine the computed CSS of an element until it's connected to the
DOM. So, now this .css call is deferred for 1 frame, which should
(._.) be enough time for it to become attached.
*/
setTimeout(() => elem.css(dependent));
setTimeout(() => {
dependent.forEach(e => elem.css(e));
});
}
/*
If HTML attributes were included in the changeDescriptor, apply them now.
......
......@@ -62,6 +62,7 @@ define(['jquery', 'macros', 'utils', 'state', 'passages', 'engine', 'datatypes/c
if (link.find('tw-error').length > 0) {
return;
}
e.stopPropagation();
event(link);
return;
}
......
......@@ -266,8 +266,6 @@ describe("interaction macros", function() {
expect($('tw-passage:last-child').find('b').text()).not.toBe("grault");
done();
},20);
done();
});
if (e.eventMethod === "click") {
it("doesn't trigger when arriving on the page by a link", function(done) {
......@@ -281,6 +279,17 @@ describe("interaction macros", function() {
done();
},20);
});
it("doesn't trigger when arriving on the page by a (link-reveal-goto:)", function(done) {
createPassage("''foo''","baz");
createPassage("(" + e.name + ":"+name+")[=''grault''","corge");
var p = runPassage("(link-reveal-goto:'corge',(t8n-arrive:'instant'))[]");
p.find('tw-link')[e.eventMethod]();
setTimeout(function() {
expect($('tw-passage:last-child').find('b').text()).not.toBe("grault");
done();
},20);
});
}
}
}
......
......@@ -474,6 +474,20 @@ describe("style changer macros", function() {
done();
});
});
it("composes with (text-rotate-x:)", function(done) {
var hook = runPassage("(text-rotate-x:160)+(text-rotate:20)[Rotated.]").find('tw-hook');
setTimeout(function() {
expect(hook.attr('style')).toMatch(/matrix3d\([^\)]+\) rotate\(20deg\)/);
done();
});
});
it("composes with (text-rotate-y:)", function(done) {
var hook = runPassage("(text-rotate-y:160)+(text-rotate:20)[Rotated.]").find('tw-hook');
setTimeout(function() {
expect(hook.attr('style')).toMatch(/matrix3d\([^\)]+\) rotate\(20deg\)/);
done();
});
});
});
describe("the (opacity:) macro", function() {
it("requires exactly 1 number argument between 0 and 1", function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment