Skip to content

Commit

Permalink
Merge pull request #3 from borgar/fix-border
Browse files Browse the repository at this point in the history
Use divs to render panels to ensure crisp panels.
  • Loading branch information
borgar committed Nov 23, 2011
2 parents 94bfac1 + 46167da commit bebce16
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
38 changes: 38 additions & 0 deletions protovis-msie.js
Expand Up @@ -672,6 +672,44 @@ pv.VmlScene.panel = function(scenes) {
return e;
};


pv.VmlScene.fill = function(e, scenes, i) {
var s = scenes[i], fill = s.fillStyle;
if (fill.opacity || s.events == "all") {
e = this.expect(e, "div", {}, {
"cursor": s.cursor,
"left": s.left,
"top": s.top,
"width": s.width,
"height": s.height,
"border": 'none',
"background": vml.color( fill.color ),
'position': 'absolute'
});
e = this.append(e, scenes, i);
}
return e;
};


pv.VmlScene.stroke = function(e, scenes, i) {
var s = scenes[i], stroke = s.strokeStyle;
if (stroke.opacity || s.events == "all") {
var linew = Math.round(s.lineWidth / this.scale);
e = this.expect(e, "div", {}, {
"cursor": s.cursor,
"left": s.left - (linew/2),
"top": s.top - (linew/2),
"width": Math.max(1E-10, s.width) - linew,
"height": Math.max(1E-10, s.height) - linew,
"border": linew + 'px solid ' + vml.color( stroke.color ),
'z-index': 1000,
'position': 'absolute'
});
e = this.append(e, scenes, i);
}
return e;
};
// Much of the event rewriting code is copyed and watered down
// from the jQuery library's event hander. We have the luxury
// of knowing that we're on MSIE<9 so we can despense with some
Expand Down

0 comments on commit bebce16

Please sign in to comment.