Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Why canvas context don't translate by global variables in onDrag event?

Consider the HTML code below:

    <canvas id="taF" draggable="true" ondrag="canvasDragging(event)">
        No Canvas Support!
    </canvas>

And this is canvasDragging and context.translate codes:

// Canvas Context

let contextX = 1000, contextY = 0;
context.translate( contextX, contextY );


// Dragging

const canvasDragging = ( event ) => {

    contextX = event.offsetX;
    contextY = event.offsetY;

}

I have checked the event and its properties but when I drag the canvas, the canvas doesn't translate and change its viewport.

Any help would be considered as a great help!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!