Bug 349 - RulerWidget: arrow does not coincide with center of block image
: RulerWidget: arrow does not coincide with center of block image
Status: RESOLVED WONTFIX
: Chameleon
Widget
: 1.99
: PC Windows 2000
: P3 minor
: FUTURE
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-04-08 03:37 by
Modified: 2005-01-11 10:49 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-04-08 03:37:36
When trying to point to a location with the ruler tool, the location clicked is 
not exactly the location which is being used for measuring. This makes it 
difficult to exactly measure things.

Or maybe this location is used for measuring, but the block image is centered 
at a different location than the location clicked with the point of the arrow.
------- Comment #1 From 2004-04-08 08:29:06 -------
agreed ... the ruler image position should be centered on the cursor rather than
the top left of the image being used.  I know that we fixed this for the
ROIPolygonTool widget, perhaps the same fix can be applied back to the ruler widget.

To be done for 1.99 if its an easy fix, otherwise we'll look at it later
------- Comment #2 From 2004-04-08 08:39:09 -------
updated version to 1.99
------- Comment #3 From 2004-05-03 16:40:20 -------
Changed Target Milestone to 1.99 RC
------- Comment #4 From 2004-08-31 16:13:17 -------
I did a fix to this by changing the shiftTo function in dhtmlapi.js file to:

function shiftTo(obj, x, y) {
	var theObj = getObject(obj)
	if (isNav4) {
		theObj.moveTo(x-4,y-4)
	} else {
		theObj.left = x - 4
		theObj.top = y - 4
	}
}

Far as I can tell the ruler is the only widget thats accessing dhtmlapi.js so 
this shouldnt break anything. Ideally I think the ruler widget should be 
changed to use the same functions as the ROIPolygonTool. The code is much 
cleaner and easier to follow and since many of the things being done are 
identical there isnt a point in having two completely different methods.

Ken
------- Comment #5 From 2004-09-01 07:56:22 -------
Ken, you are absolutely correct and that has been one of the things on my list
for some time.  The ruler widget was developed with contributed code very early
on, before we really gained a lot of knowledge about javascript and dhtml.  The
ROIPolygonTool was a complete re-write of that logic, but it has not yet been
ported back to the ruler tool.

I would actually like to extract all the code for various dhtml drawing routines
into one consolidated api and have the various widgets 'use' the drawing tools.
 But that will not happen in this release unfortunately.
------- Comment #6 From 2004-11-04 18:11:58 -------
Ruler is on my hitlist for a complete overhaul, I've seen much better
implementations than ours.
------- Comment #7 From 2005-01-11 10:49:06 -------
marking as wontfix because I want any time spent on the ruler widget to go into
reimplementing it.  see bug 923