diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-08 03:37:27 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-08 03:37:27 +0100 |
commit | 319accba370d3f0872501de6386833fea140fbac (patch) | |
tree | f024ac1070837693b39b6624eea3bd104f8a0f0b /src/mgui/scrollview.c | |
parent | 864ee5f167d1e2dda9bfce24ef617d71ce49bfd8 (diff) |
Add richtext, support multi language
Diffstat (limited to 'src/mgui/scrollview.c')
-rw-r--r-- | src/mgui/scrollview.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mgui/scrollview.c b/src/mgui/scrollview.c index ae9ad97..e5b8bb8 100644 --- a/src/mgui/scrollview.c +++ b/src/mgui/scrollview.c @@ -35,6 +35,7 @@ mgui_scrollview* mgui_widget_to_scrollview(mgui_widget *widget) { void mgui_scrollview_set_child(mgui_scrollview *self, mgui_widget *child) { assert(child != mgui_scrollview_to_widget(self)); self->child = child; + mgui_scrollview_set_width(self, self->size.x); } void mgui_scrollview_set_position(mgui_scrollview *self, mgl_vec2i position) { @@ -43,12 +44,13 @@ void mgui_scrollview_set_position(mgui_scrollview *self, mgl_vec2i position) { void mgui_scrollview_set_size(mgui_scrollview *self, mgl_vec2i size) { self->size = size; + mgui_scrollview_set_width(self, self->size.x); } void mgui_scrollview_set_width(mgui_scrollview *self, int width) { /* TODO: Call for child so text can wordwrap? but only if wordwrap is enabled in this scrollview */ - (void)self; - (void)width; + if(self->child) + mgui_widget_set_width(self->child, width); } void mgui_scrollview_on_event(mgui_scrollview *self, mgl_window *window, mgl_event *event) { |