slideToObjectPos : uncertain final position
Posted: 16 November 2019, 22:04
Hi.
I have been using slideToObjectPos();
I have noticed that the end coordinate position was not quite ending in the correct position, so I did some detailed analysis to see what was going on.
I moved the same object (blocker) between the same 2 locations:
Note in my log I write [x,y] div.outerHTML.
The x,y are the coordinate postion I want to move to. There is a difference between x,y and the final left,top but I assume it's always just an offset of some kind. The important thing is just the consistency of the co-ordinates I asked for (pass as parameters) and the final left, top position.
A. If I use placeOnObjectPos, the final position is always OK.
B. If I use slideToObjectPos then the final position is at best loosely in the right area.
Secondly, minor point - I've also noticed that between the 2 functions. placeOnObjectPos and slideToObjectPos:
slideToObjectPos is offset by the image width and height, while
placeOnObjectPos is not (I think it's automatically centred).
I have been using slideToObjectPos();
I have noticed that the end coordinate position was not quite ending in the correct position, so I did some detailed analysis to see what was going on.
I moved the same object (blocker) between the same 2 locations:
Note in my log I write [x,y] div.outerHTML.
The x,y are the coordinate postion I want to move to. There is a difference between x,y and the final left,top but I assume it's always just an offset of some kind. The important thing is just the consistency of the co-ordinates I asked for (pass as parameters) and the final left, top position.
A. If I use placeOnObjectPos, the final position is always OK.
Code: Select all
//this.placeOnObjectPos( token.key, 'map_scrollable_oversurface', xxx, yyy );
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 13px; left: -75px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
//[-41.6 :: -177.6]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: -228px; left: -92px; transform: scale(0.25, 0.25) rotate(120deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 13px; left: -75px; transform: scale(0.25, 0.25) rotate(180deg);"></div>B. If I use slideToObjectPos then the final position is at best loosely in the right area.
Code: Select all
//this.slideToObjectPos(token.key, 'map_scrollable_oversurface', xxx, yyy, 0).play();
//[-41.6 :: -177.6]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: -227.5px; left: -91.5px; transform: scale(0.25, 0.25) rotate(120deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 17.0753px; left: -69.9247px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
//[-41.6 :: -177.6]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: -227.487px; left: -91.5028px; transform: scale(0.25, 0.25) rotate(120deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 17.0727px; left: -69.9275px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 12.5102px; left: -74.5056px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
//[-41.6 :: -177.6]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: -227.49px; left: -91.5056px; transform: scale(0.25, 0.25) rotate(120deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 17.0697px; left: -69.9303px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
//[-25 :: 62.5]<div class="tokenB Bff0000 blocker" id="blocker_0_2308260" style="top: 12.5072px; left: -74.5084px; transform: scale(0.25, 0.25) rotate(180deg);"></div>
slideToObjectPos is offset by the image width and height, while
placeOnObjectPos is not (I think it's automatically centred).