FyroxEngine/Fyrox · error
Node column out of bounds
Error message
Node column out of bounds: {} row:{}, column:{} What it means
The Grid widget arranges children by (row, column) indices into its internal row/column size collections. This error is logged when a child node's column index is >= the number of columns the grid knows about (no matching column slot exists), so that child is skipped during measurement.
Solutions
- Ensure the grid's column definitions (e.g. via `GridBuilder::draw_columns` / column count) cover every child's `column` index
- Clamp or validate each child's row/column against grid dimensions before adding it
- Log/inspect which node has the bad index using the type name printed in the message and fix its WidgetBuilder on_column value
- Check for off-by-one errors: columns are 0-based, so a 3-column grid accepts columns 0..=2
Example fix
// before TextBuilder::new(WidgetBuilder::new().on_row(0).on_column(5)) // after let column = 5.min(grid_columns - 1); TextBuilder::new(WidgetBuilder::new().on_row(0).on_column(column))
Defensive patterns
Strategy: validation
Validate before calling
fn grid_child_is_in_bounds(grid_cols: usize, grid_rows: usize, row: usize, column: usize) -> bool {
row < grid_rows && column < grid_cols
} Type guard
fn valid_cell(grid_cols: usize, grid_rows: usize, b: &WidgetBuilder) -> bool {
b.row.unwrap_or(0) < grid_rows && b.column.unwrap_or(0) < grid_cols
} Prevention
- Keep a single source of truth for grid row/column counts and derive child indices from it
- Clamp child indices at the point of construction
- Watch for off-by-one errors with 0-based indices
When it happens
Trigger: Adding a Grid child whose `column` value exceeds the grid's column count (or before columns are defined), e.g. `WidgetBuilder::new().on_row(0).on_column(5)` on a grid that only has 3 columns, or mutating grid column definitions after children were added.
Common situations: Building grid UIs programmatically with hardcoded indices; binding children from data where the column index comes from unvalidated config/data; increasing row/column definitions out of sync with existing children after style or layout changes.
Related errors
- Node row out of bounds
- Window width was
- Window height was
- Cannot add window to split tile
- Cannot subtract window from split tile
AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10).
Data as JSON: /api/errors/86a9f2fb25bca064.
Report an issue: GitHub.
Appendix: source
Thrown at fyrox-ui/src/grid.rs:466
SizeMode::Strict => dim.actual_size = dim.desired_size,
SizeMode::Stretch => (),
}
}
for handle in self.children() {
let Ok(node) = ui.try_get_node(*handle) else {
continue;
};
let Some(row) = rows.get_mut(node.row()) else {
Log::err(format!(
"Node row out of bounds: {} row:{}, column:{}",
node.type_info_ref().type_name,
node.row(),
node.column()
));
continue;
};
let Some(col) = cols.get_mut(node.column()) else {
Log::err(format!(
"Node column out of bounds: {} row:{}, column:{}",
node.type_info_ref().type_name,
node.row(),
node.column()
));
continue;
};
if col.size_mode == SizeMode::Auto {
col.unmeasured_node_count += 1
}
if row.size_mode == SizeMode::Auto {
row.unmeasured_node_count += 1
}
}
}
fn measure_width_and_height(
&self,
child: Handle<UiNode>,View on GitHub (pinned to 76c91aad8e)