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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:24:16+00:00 2026-05-15T12:24:16+00:00

When drawing on a canvas in firefox, if you attempt to draw at or

  • 0

When drawing on a canvas in firefox, if you attempt to draw at or move to a point beyond the bounds of the canvas, an error will be thrown (this is copied/pasted directly from Firebug):

An invalid or illegal string was specified" code: "12

Other browsers won’t throw the error. This is for both the drawing methods (lineTo, arc, etc), as well as image drawing. It’s easy enough to do a quick bounds check using the width and height of the canvas before drawing, but what about drawing parts of things?

For example, let’s say you have a circle, defined by a center point and a radius, and drawn with an arc(). If you do a bounds check, the center could be off the canvas, while part of the circle should still technically be visible. Therefore, the circle will either be drawn completely or not at all: there’s no way to make only part of the circle drawn if the center point is off the canvas.

Does anyone have a work around for this?

One that I thought of was using a large “world buffer” canvas that is then copied from to the display canvas. Another might be drawing each object in the center of a buffer canvas, then copying the newly drawn pixels to the display canvas in their proper position.

What have people done to work around this issue?

  • 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-15T12:24:16+00:00Added an answer on May 15, 2026 at 12:24 pm

    The canvas crops the image to the bounding rectangle of its view. You should have no problem drawing outside this bounding box. It will not show up on your drawing. Post a particular example to see if we can reproduce the error.

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

Sidebar

Related Questions

On drawing on canvas if i use this code to draw the bitmap then
I'm drawing simple text in HTML5 canvas using this: context.fillStyle = #FF0000 context.font =
All of my canvas drawing functions start something like this: function drawMe(){ var canvas
I have an html5 canvas drawing application similar to this http://jsfiddle.net/rnNFB/1/ , but using
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Is there an open-source toolkit out there that has a few simple canvas drawing
What am I doing wrong here? Im trying to save a canvas drawing by
I am using a large JS library to perform certain drawing operations in canvas.
I'm drawing an image to a canvas element. I then have code that depends
I'm drawing a map on a canvas using squares 40px * 40px. All is

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.