MCPcopy Create free account
hub / github.com/ZDoom/Raze / LayoutFloatBlock

Method LayoutFloatBlock

libraries/ZWidget/src/core/span_layout.cpp:545–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545void SpanLayout::LayoutFloatBlock(CurrentLine& current_line, double max_width)
546{
547 FloatBox floatbox;
548 floatbox.type = objects[current_line.object_index].type;
549 floatbox.image = objects[current_line.object_index].image;
550 floatbox.component = objects[current_line.object_index].component;
551 floatbox.id = objects[current_line.object_index].id;
552 if (objects[current_line.object_index].type == object_image)
553 floatbox.rect = Rect::xywh(0, current_line.y_position, floatbox.image->GetWidth(), floatbox.image->GetHeight());
554 else if (objects[current_line.object_index].type == object_component)
555 floatbox.rect = Rect::xywh(0, current_line.y_position, floatbox.component->GetWidth(), floatbox.component->GetHeight());
556
557 if (objects[current_line.object_index].float_type == float_left)
558 floats_left.push_back(FloatBoxLeft(floatbox, max_width));
559 else
560 floats_right.push_back(FloatBoxRight(floatbox, max_width));
561
562 ReflowLine(current_line, max_width);
563}
564
565void SpanLayout::ReflowLine(CurrentLine& step, double max_width)
566{

Callers

nothing calls this directly

Calls 3

GetWidthMethod · 0.45
GetHeightMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected