Skip to content

Commit

Permalink
Added button color transformation and support for buttons tracked as …
Browse files Browse the repository at this point in the history
…menu
  • Loading branch information
Tobias Schneider committed Jun 12, 2010
1 parent 2730853 commit bd12e53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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){
Expand All @@ -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] = {});
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit bd12e53

Please sign in to comment.