CMO Movement Top Left Corner based
Bug #966750 reported by
Russ Adams
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Asgard |
Fix Committed
|
Undecided
|
Sean Eubanks |
Bug Description
If you click on the screen and leave your mouse in place, you'll see the CMO will travel to that spot. You'll notice that when she arrives, her top left corner will be underneath the mouse cursor. All math surrounding CMO movement should be around the center of the CMO.
Map Panning will face similar issues... the root cause for this and lp:966741 are the same.
Related branches
Changed in asgard: | |
status: | New → Confirmed |
Changed in asgard: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
The solution here is that we need to move MapObjects based on the center of the MapObject, not on its Top Left Corner.
Related (lp:966741) is that Map Pan events need to alter their checks as follows:
1. if the bottom of the MapObject has passed the bottom margin of the screen, fire a map pan event.
2. if the top of the MapObject has passed the top margin of the screen, fire a map pan event.
3. if the right of the MapObject has passed the right margin of the screen, fire a map pan event.
4. if the left of the MapObject has passed the left margin of the screen, fire a map pan event.
Right now each of these checks is against only the Top Left Corner of the Map Object.
It should be easy enough to write MapObject: :getBottom( ), getTop(), getLeft(), getRight(), and getCenter() since MapObjects have height and a width members. The problem is that MapObject height and width are tightly coupled to Drawable height and width. My Big Question is this:
Can we drop MapObject::height and MapObject::width, and instead have MapObject: :getHeight( ) and MapObject: :getWidth( ) return the respective height and width of the MapObject's current Drawable? Can you think of any problem with that approach?
That would allow us to get rid of the height and width fields in the MapObject table. We could then easily write MapObject: :getBottom( ), getTop(), getLeft(), getRight(), and getCenter() based on the Drawable's height and width and the current Top Left Corner of the MapObject.
Those accessors could then be used to solve both this case and lp:966741.