Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8955455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:33:44+00:00 2026-06-15T14:33:44+00:00

I have a path containing two arcs, the first arc is created and when

  • 0

I have a path containing two arcs, the first arc is created and when the second one is created they are automatically connected/joined given that they are contained within the same path, but they are only joined at one end, at the other there is nothing, how do I tell it to join at the other end as well?

Working example can be found here (though it actually contains 4 arcs, but 2 for each path): http://jsfiddle.net/QjLT2/

enter image description here

var ctx = document.getElementById("display").getContext('2d');

ctx.beginPath();
ctx.arc(100, 100, 20, Math.PI/2, 0.0, true);
ctx.arc(100, 100, 50, 0.2, Math.PI/2, false);
//ctx.lineTo(100, 100+17);

ctx.strokeStyle = 'blue';
ctx.lineWidth = 5;
ctx.stroke();
ctx.closePath();

ctx.beginPath();
ctx.arc(200, 200, 20, Math.PI/1.5, 0.0, true);
ctx.arc(200, 200, 50, 0.0, Math.PI/1.5, false);
//ctx.lineTo(200, 200+17);

ctx.strokeStyle = 'blue';
ctx.lineWidth = 5;
ctx.stroke();
ctx.closePath();
​
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:33:46+00:00Added an answer on June 15, 2026 at 2:33 pm

    See here: http://jsfiddle.net/QjLT2/6/

    1) You don’t need to set strokeStyle or lineWidth more than once, unless you are actually changing the values. Doing so actually reduces performance as the context has a concept of “state” that it tracks.

    2) You need to call closePath before calling stroke if you want the completed path to be stroked.

    var ctx = document.getElementById("display").getContext('2d');
    
    ctx.strokeStyle = 'blue';
    ctx.lineWidth = 5;
    
    ctx.beginPath();
    ctx.arc(100, 100, 20, Math.PI/2, 0.0, true);
    ctx.arc(100, 100, 50, 0.0, Math.PI/2, false);
    ctx.closePath();
    
    ctx.stroke();
    
    ctx.beginPath();
    ctx.arc(200, 200, 20, Math.PI/1.5, 0.0, true);
    ctx.arc(200, 200, 50, 0.0, Math.PI/1.5, false);
    ctx.closePath();
    
    ctx.stroke();​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written two simple Java classes (one of them containing main(), and the
I have a VS2008 solution containing two C++ projects. One is a Win32/console .dll
So essentially, I have two hashmaps, one containing the following values: rId33=image23 rId32=image22 rId37=image2
I have two Android projects, a 'library project' containing a custom layout, and an
I have created a class extending SimpleXMLElement which loads an XML containing translations for
When I have two sql-files, one of them in a sub-directory main_test.sql sub/sub_test.sql and
I have two Visual Studio solutions, one for WebApi and one for WP7 development,
Suppose I just created a package example and have two classes inside it, Main
In my installer, I have two features. If I disable one feature, the Browse
I have two svn repositories, one each for the iOS and Android versions of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.