I put another display group inside of the scrollview and I am scaling the display group. I tried what you said and it doesn’t seem to be working. I scale the group to .98 and then multiply the position by that and it still goes to the left and up when i release the tile.
The display group is named bdgroup and I am scaling it this way:
transition.scaleTo( bgroup, { xScale=.98, yScale=.98, time=100 } )
Then for moving the tile and dropping it I am using this code. When the tile is dropped I am getting the scrollview position to offset the actual position, insert the tile into the group and place it there. What I did works fine when nothing is scaled. Then when I scale and add the code to multiply by .98 it goes up and left when dropped.
local function onTileTouch( event ) local t = event.target local phase = event.phase if "began" == phase then -- Make target the top-most object local parent = t.parent parent:insert( t ) display.getCurrentStage():setFocus( t ) -- Spurious events can be sent to the target, e.g. the user presses -- elsewhere on the screen and then moves the finger over the target. -- To prevent this, we add this flag. Only when it's true will "move" -- events be sent to the target. t.isFocus = true -- Store initial position t.x0 = event.x - t.x t.y0 = event.y - t.y elseif t.isFocus then if "moved" == phase then -- Make object move (we subtract t.x0,t.y0 so that moves are -- relative to initial grab point, rather than object "snapping"). t.x = event.x - t.x0 t.y = event.y - t.y0 elseif "ended" == phase or "cancelled" == phase then display.getCurrentStage():setFocus( nil ) t.isFocus = false bgroup:insert( t ) --Tried this here and also below 5 lines. Same results. t.x = t.x \* .98 t.y = t.y \* .98 local x, y = scrollView:getContentPosition() t.x = t.x + (x \* -1) - scrollView.x t.y = t.y + (y \* -1) - scrollView.y t:removeEventListener( "touch", onTileTouch ) end end -- Important to return true. This tells the system that the event -- should not be propagated to listeners of any objects underneath. return true end