From def04a936116cbadc51bc8d57dcba83656db75c6 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 8 Oct 2025 18:36:54 +0200 Subject: [PATCH] api comments --- include/pgpl/gui/predef.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/pgpl/gui/predef.h b/include/pgpl/gui/predef.h index a993af4..f4c1bfa 100644 --- a/include/pgpl/gui/predef.h +++ b/include/pgpl/gui/predef.h @@ -98,7 +98,8 @@ struct PGPL_GuiWidget { double max_height); /* This renders the content of the widget. Note that the margin, border, * padding, background and offset of the widget must be accounted for BEFORE - * calling this function. For ease, you can use the + * calling this function. This includes any possible centering of the widget + * that may happen beforehand as well. For ease, you can use the * pgpl_gui_widget_render_full function to automatically take care of all of * those things for you. */ void (*render_content)(PGPL_GuiWidget *widget, PGPL_Renderer *renderer, @@ -106,7 +107,11 @@ struct PGPL_GuiWidget { double max_width, double max_height); /* This should get called for every event that is not a render or close event. * Note that the x and y values should be called with the widgets offset - * pre-included. */ + * pre-included, however the margin, padding and border should NOT be + * compensated for. This can be easily done inside of this method with the + * pgpl_gui_widget_adjust_event_params function, which adjusts the function + * parameters to match those that would have been passed to the render_content + * function. */ void (*event)(PGPL_GuiWidget *widget, PGPL_GuiTheme *theme, PGPL_Gui *gui, PGPL_WindowEventType event_type, PGPL_WindowEventData *event_data, double x, double y,