diff --git a/code/_onclick/hud/screen_objects/storage.dm b/code/_onclick/hud/screen_objects/storage.dm index 627893df1f..bf560841bb 100644 --- a/code/_onclick/hud/screen_objects/storage.dm +++ b/code/_onclick/hud/screen_objects/storage.dm @@ -76,15 +76,16 @@ /obj/screen/storage/volumetric_box/proc/on_screen_objects() return list(src, left, right) +#define BOX_ICON_PIXELS 32 /obj/screen/storage/volumetric_box/proc/set_pixel_size(pixels) cut_overlays() //our icon size is 32 pixels. - transform = matrix(32 / pixels, 0, 0, 0, 1, 0) - left.pixel_x = -(pixels * 0.5) - 4 - right.pixel_x = (pixels * 0.5) + 4 + transform = matrix(pixels / BOX_ICON_PIXELS, 0, 0, 0, 1, 0) + left.pixel_x = -((BOX_ICON_PIXELS - pixels) * 0.5) - 4 + right.pixel_x = ((BOX_ICON_PIXELS - pixels) * 0.5) + 4 add_overlay(left) add_overlay(right) - pixel_x = (pixels - 32) * 0.5 +#undef BOX_ICON_PIXELS /obj/screen/storage/stored_left icon_state = "stored_start" diff --git a/code/datums/components/storage/ui.dm b/code/datums/components/storage/ui.dm index da3094a2c9..0d606a2f84 100644 --- a/code/datums/components/storage/ui.dm +++ b/code/datums/components/storage/ui.dm @@ -124,7 +124,7 @@ // now that we have pixels_to_use, place our thing and add it to the returned list. - B.screen_loc = I.screen_loc = "[screen_start_x]:[current_pixel],[screen_start_y]:[screen_pixel_y]" + B.screen_loc = I.screen_loc = "[screen_start_x]:[current_pixel + (pixels_to_use * 0.5)],[screen_start_y]:[screen_pixel_y]" // add the used pixels to pixel after we place the object current_pixel += pixels_to_use @@ -149,14 +149,14 @@ . += ui_continuous // Then, left and right. ui_left = get_ui_left() - ui_left.screen_loc = "[screen_start_x]:[screen_pixel_x - 2],[screen_start_y]:[screen_pixel_y] to [screen_start_x]:[screen_pixel_x - 2],[screen_start_y]:[screen_pixel_y]" + ui_left.screen_loc = "[screen_start_x]:[screen_pixel_x - 2],[screen_start_y]:[screen_pixel_y]" . += ui_left ui_right = get_ui_right() - ui_right.screen_loc = "[screen_start_x+maxcolumns-1]:[screen_pixel_x + 2],[screen_start_y]:[screen_pixel_y] to [screen_start_x+maxcolumns-1]:[screen_pixel_x + 2],[screen_start_y]:[screen_pixel_y]" + ui_right.screen_loc = "[screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]" . += ui_right // Then, closer. ui_close = get_ui_close() - ui_close.screen_loc = "[screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]" + ui_close.screen_loc = "[screen_start_x + maxcolumns]:[screen_pixel_x + 2],[screen_start_y]:[screen_pixel_y]" . += ui_close /**