Created
July 15, 2012 21:13
-
-
Save dherman/3118659 to your computer and use it in GitHub Desktop.
canvas line connecting compat issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<head> | |
<title>Canvas Test</title> | |
<style> | |
#c { | |
border: solid 1px black; | |
} | |
</style> | |
</head> | |
<body> | |
<canvas id=c width=300 height=300></canvas> | |
<script> | |
var cx = document.getElementById('c').getContext('2d'); | |
// Draw two line segments. On Firefox and Safari they | |
// are connected, but on Chrome they have a missing pixel | |
// at the corner. What am I missing? | |
cx.moveTo(100.5, 200.5); | |
cx.lineTo(200.5, 200.5); | |
cx.stroke(); | |
cx.moveTo(200.5, 200.5); | |
cx.lineTo(200.5, 100.5); | |
cx.stroke(); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment