mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Merge pull request #8021 from RemieRichards/AltClick-PixelPlacement-InteractionFix
Table-Item Pixel Placement Improvements
This commit is contained in:
@@ -324,8 +324,11 @@
|
||||
I.Move(loc)
|
||||
var/list/click_params = params2list(params)
|
||||
//Center the icon where the user clicked.
|
||||
I.pixel_x = (text2num(click_params["icon-x"]) - 16)
|
||||
I.pixel_y = (text2num(click_params["icon-y"]) - 16)
|
||||
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
|
||||
return
|
||||
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||
I.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user