Conversation
|
I'm brain fried I'll review tomorrow or this weekend, but if right and bottom imgui windows still work then it's probably fine, let's worry about left guis when there's a compelling use case? |
|
Okay, the reason that it is not shifting down is because updates to the layout use the fractional layout to resize, and the rect manager does not take into account x or y offset when doing this |
|
📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/top-gui |
|
@kushalkolar gtg if you can give a review! |
| def _fpl_reset_layout(self, *ev): | ||
| """set the viewport rects for all subplots, *ev argument is not used, exists because of renderer resize event""" | ||
| self.layout.canvas_resized(self.get_pygfx_render_area()) | ||
|
|
There was a problem hiding this comment.
Confused, this exact method exists in the parent class 🤔
|
|
||
| # add 4 pixels above and below title for better spacing | ||
| y = y + 4 + self._title_graphic.font_size + 4 | ||
| y = + y + 4 + self._title_graphic.font_size + 4 |
| _, _, cw, ch = self._canvas_rect | ||
| mult = np.array([cw, ch, cw, ch]) | ||
| rect = np.asarray(rect, dtype=float).copy() | ||
| x_offset, y_offset, cw, ch = self._canvas_rect |
There was a problem hiding this comment.
The _canvas_rect here is actually the pygfx render area part of the canvas right? I should've made that easier to understand, we could change the name and add more comments?
| if rect[0] + rect[2] > cw: | ||
|
|
||
| # account for potential x and y offset | ||
| local = rect.copy() |
|
|
||
| self._rect_frac[:] = rect / mult | ||
| self._rect_frac[:] = local / mult | ||
| self._rect_screen_space[:] = rect |
There was a problem hiding this comment.
the fract is set with local, but the screen space is set directly?
|
Tested that the window layouts subplots move and resize properly with these changes? We can make automated tests for that later. |

I thought this would follow the patterns of the other guis (just change the y pos of where pygfx renders to), but the render space does not actually move down unless I manually set the rect
Maybe that is not something that needs to be done for bottom and right but does for a left or top gui
Have enough for the thing I need to do for clepio and can circle back to this
@kushalkolar thoughts welcome since you did the frame/rect manager stuff