+void InitGadgetScreenBorders(int border_right, int border_bottom)
+{
+ gadget_screen_border_right = border_right;
+ gadget_screen_border_bottom = border_bottom;
+}
+
+static int getGadgetScreenBorderRight(void)
+{
+ if (gadget_screen_border_right < gfx.sx ||
+ gadget_screen_border_right > gfx.sx + gfx.sxsize)
+ return gfx.sx + gfx.sxsize;
+
+ return gadget_screen_border_right;
+}
+
+static int getGadgetScreenBorderBottom(void)
+{
+ if (gadget_screen_border_bottom < gfx.sy ||
+ gadget_screen_border_bottom > gfx.sy + gfx.sysize)
+ return gfx.sy + gfx.sysize;
+
+ return gadget_screen_border_bottom;
+}
+