nic.sicily Posted April 15, 2019 Share Posted April 15, 2019 The following simple code draws, in addition to the two circles, also a mysterious horizontal line between the two circles. How can I solve it? <script> var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.beginPath(); ctx.arc (250, 250, 200, 0, 2*Math.PI); ctx.arc (250, 250, 180, 0, 2*Math.PI); ctx.stroke(); </script> Link to comment Share on other sites More sharing options...
Funce Posted April 16, 2019 Share Posted April 16, 2019 Between beginPath and stroke is a single line as if you were holding the pen down on a piece of paper. You're going to need to put each arc between different beginPath and stroke function calls. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now