Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added button color transformation and support for buttons tracked as …

…menu
  • Loading branch information...
commit bd12e533e6ad5313f74cd061f1962a7e829f19a9 1 parent 2730853
Tobias Schneider authored
Showing with 7 additions and 5 deletions.
  1. +4 −3 src/parser.js
  2. +3 −2 src/renderer/svg.js
View
7 src/parser.js
@@ -444,7 +444,7 @@
return t;
},
- _handleDefineButton: function(s, offset, len, frm, withActions){
+ _handleDefineButton: function(s, offset, len, frm, advanced){
var id = s.readUI16(),
t = this,
d = t._dictionary,
@@ -453,9 +453,9 @@
type: "button",
id: id,
states: states,
- trackAsMenu: withActions ? s.readBool(8) : false
+ trackAsMenu: advanced ? s.readBool(8) : false
};
- if(withActions){ s.seek(2); }
+ if(advanced){ s.seek(2); }
do{
var flags = s.readUI8();
if(flags){
@@ -467,6 +467,7 @@
depth: depth,
matrix: s.readMatrix()
};
+ if(advanced){ character.cxform = s.readCxformA(); }
while(state <= 0x08){
if(flags & state){
var list = states[state] || (states[state] = {});
View
5 src/renderer/svg.js
@@ -492,7 +492,8 @@
stateNodes = {},
currState = b.UP,
m = Gordon.mouseButtons,
- isMouseOver = false;
+ isMouseOver = false,
+ trackAsMenu = obj.trackAsMenu;
for(var s in buttonStates){ stateNodes[s] = node.getElementsByClassName(buttonStates[s])[0]; }
var hitNode = stateNodes[b.HIT];
@@ -525,7 +526,7 @@
hitNode.onmouseout = function(e){
isMouseOver = false;
- if(!t.eventTarget){ setState(this == t.eventTarget ? b.OVER : b.UP); }
+ if(!t.eventTarget || trackAsMenu){ setState(b.UP); }
return false;
};
Please sign in to comment.
Something went wrong with that request. Please try again.