This is just personal preference, but I liked to use the lower right corner of the structure as the mouse location and snap it to the lower right corner of the square the mousecursor is at. With a maximum of x grid squares from the character's position. I have no idea how you coded your grid and it's to be multi-platform so I have no idea if that's feasible.
Like I said; Personal preference. I'm sure you'll figure it out or can ask someone more knowledgeable than me. Good luck!