Expected behavior
The graph should rescale along with the lines.
Screenshots
Running the line_chart example.
At launch:
After maximizing and minimizing:
Desktop (please complete the following information):
OS: Linux
Godot Engine Version: 4.3
Plugin Version: v24.05.06
Additional context
Seems like the root cause is that get_rect() (being called inside BoxPlot.get_box() and BoxPlot.get_plot_box()) doesn't update right away. So some parts of the redraw are scaled incorrectly.
I think I fixed it by adding this code to box_plot.gd:
func _on_resized() -> void:
$GridBox.queue_redraw()
for function in $FunctionsBox.get_children():
function.queue_redraw()
_on_resized is connected to the BoxPlotresized signal.
This seems to fix the issue. I have no idea if this is the correct way to fix it or if it is the most efficient. I am not even clear on why this is necessary, seems like it would make sense for Godot to not call queue_redraw() until all the parents are updated. I probably don't understand the code well enough. Anyway, I hope this is helpful!
Describe the bug It's in the title.
To Reproduce Steps to reproduce the behavior:
Expected behavior The graph should rescale along with the lines.
Screenshots Running the
line_chart
example.At launch:
After maximizing and minimizing:
Desktop (please complete the following information):
Additional context Seems like the root cause is that
get_rect()
(being called insideBoxPlot.get_box()
andBoxPlot.get_plot_box()
) doesn't update right away. So some parts of the redraw are scaled incorrectly.I think I fixed it by adding this code to
box_plot.gd
:_on_resized
is connected to theBoxPlot
resized
signal.This seems to fix the issue. I have no idea if this is the correct way to fix it or if it is the most efficient. I am not even clear on why this is necessary, seems like it would make sense for Godot to not call
queue_redraw()
until all the parents are updated. I probably don't understand the code well enough. Anyway, I hope this is helpful!