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 6999073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:29:38+00:00 2026-05-27T20:29:38+00:00

I’ve been working on a doodling app recently just for kicks. After trying many

  • 0

I’ve been working on a doodling app recently just for kicks. After trying many methods to draw smooth curves with the sample points given by the mouse, I’ve settled for something using Quadratic Curve.

I must admit, my understanding of these curves is not optimal but I think I understood how they work. What I can’t understand is that when I draw a curve which goes up and then suddenly down, the peak of the curve is not rounded anymore (it looks flattened).

A demo is much better to understand what I’m talking about: link to JCanvas sandbox

If you remove the last part of the curve (from cx11 to y15): link to another JCanvas sandbox. It looks fine, but when you add the next control point and end point, you get this weird effect.

Note: I’m not using JCanvas, but it has the same bug and the sandbox is handy. I guess it comes from the coordinates I get, but I can’t explain and can’t find a workaround/hack to make it look rounded…

For those who can’t be bothered with the sandbox, here’s a short version of the coordinates which are causing the problem:

x1: 216, y1: 98,
cx1: 216, cy1: 97,
x2: 216, y2: 98,
cx2: 216, cy2: 99,
x3: 215, y2: 103,

Any ideas on why? Mathematicals stuff are welcome. I’ve done a bit of searching and reading about the problem but didn’t find anything about something similar.

—

Update

As Simon pointed out, I’m using Chrome 16 and I’ve tested the example with Firefox 4 and the latest Safari and the bug is there. I tried with Opera and it looks fine.

I’m rather frustrated about that as the bug is also on the iPad and I was trying to do a mobile web app so I’m sort of stuck.

Any ideas for a workaround/hack?

  • 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-05-27T20:29:39+00:00Added an answer on May 27, 2026 at 8:29 pm

    Found a workaround. It’s one of those silly as-blah-approaches-zero bugs, I don’t really know the proper name for them. It’s hard to round a corner if the connection between two points is a very tiny vertical line and Safari gets confused.

    At the location of your problem there is a 1 pixel high vertical line curve that needs to be rounded.

    If the X destination is identical between one quadratic curve and the next, safari will give you problems. So this is bad:

    ctx.beginPath();
    ctx.moveTo(161,178);
    ctx.quadraticCurveTo(215, 102, 216, 100);
    ctx.quadraticCurveTo(216, 98, 216, 98);
    ctx.quadraticCurveTo(216, 99, 215, 103); // I have the same X as the previous quadratic
    ctx.quadraticCurveTo(213, 107, 211, 120);
    ctx.quadraticCurveTo(209, 133, 209, 145);
    ctx.stroke();
    

    See it here: http://jsfiddle.net/Ws6UY/

    So if we just change that value the tiniest amount:

    ctx.beginPath();
    ctx.moveTo(161,178);
    ctx.quadraticCurveTo(215, 102, 216, 100);
    ctx.quadraticCurveTo(216, 98, 216, 98);
    ctx.quadraticCurveTo(216.01, 99, 215, 103); // 216.01 is not the same X as 216!
    ctx.quadraticCurveTo(213, 107, 211, 120);
    ctx.quadraticCurveTo(209, 133, 209, 145);
    ctx.stroke();
    

    See it here: http://jsfiddle.net/Ws6UY/1/

    How silly! All you have to do to keep safari/iOS browsers working is make sure that the x (And probably y) values are not identical to the last point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.