Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

modify the getWordAtLocation() function in the client-side javascript so it too is aware of the width of the word you are trying to drag. function

modify the getWordAtLocation() function in the client-side javascript so it too is aware of the width of the word you are trying to drag. function getWordAtLocation(aCanvasX, aCanvasY)

{

//locate the word near aCanvasX,aCanvasY

//Just use crude region for now. //should be improved to using length of word etc.

//note you will have to click near the start of the word

//as it is implemented now const

TOLERANCE = 50;

for (let i = 0; i < words.length; i++)

{ if (Math.abs(words[i].x - aCanvasX) < TOLERANCE && Math.abs(words[i].y - aCanvasY) < TOLERANCE)

return words[i]

}

return null

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

Students also viewed these Databases questions

Question

Roughly speaking, what is an experiment? an event?

Answered: 1 week ago

Question

Define and describe the sections in a job description.

Answered: 1 week ago

Question

Discuss the relationship between job analysis and HRM processes.

Answered: 1 week ago