Clang fixes

This commit is contained in:
Michael Davidson 2023-12-17 22:22:36 +11:00
parent 2227a091c5
commit fc6aa95ac4
No known key found for this signature in database
GPG Key ID: B8D1A99712B8B0EB
3 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ void RootLayoutComponent::dump_config() {
void RootLayoutComponent::render_at(display::Display *display, int x, int y) { void RootLayoutComponent::render_at(display::Display *display, int x, int y) {
display->set_local_coordinate(x, y); display->set_local_coordinate(x, y);
display::Rect layout _rect = this->layout_root_->measure_item(display); display::Rect layout_rect = this->layout_root_->measure_item(display);
display::Rect clipping_rect = display::Rect(x, y, layout_rect.w, layout_rect.h); display::Rect clipping_rect = display::Rect(x, y, layout_rect.w, layout_rect.h);
// TODO: Should clipping be relative to local? // TODO: Should clipping be relative to local?
@ -29,7 +29,7 @@ void RootLayoutComponent::render_at(display::Display *display, int x, int y) {
this->layout_root_->render(display, layout_rect); this->layout_root_->render(display, layout_rect);
display->pop_local_coordinates(); display->pop_local_coordinates();
display->shrink_clipping(clipping_rect); display->shrink_clipping(clipping_rect);
} }
} // namespace graphical_layout } // namespace graphical_layout

View File

@ -27,7 +27,7 @@ public:
* param[in] y: y coorindate to render at * param[in] y: y coorindate to render at
*/ */
void render_at(display::Display *display, int x, int y); void render_at(display::Display *display, int x, int y);
void set_layout_root(LayoutItem *layout) { this->layout_root_ = layout; }; void set_layout_root(LayoutItem *layout) { this->layout_root_ = layout; };
protected: protected:

View File

@ -12,20 +12,20 @@ namespace graphical_layout {
class LayoutItem { class LayoutItem {
public: public:
/** Measures the item as it would be drawn on the display and returns the bounds for it /** Measures the item as it would be drawn on the display and returns the bounds for it
* *
* param[in] display: Display that will be used for rendering. May be used to help with calculations * param[in] display: Display that will be used for rendering. May be used to help with calculations
*/ */
virtual const display::Rect measure_item(display::Display *display) = 0; virtual const display::Rect measure_item(display::Display *display) = 0;
/** Perform the rendering of the item to the display /** Perform the rendering of the item to the display
* *
* param[in] display: Display to render to * param[in] display: Display to render to
* param[in] bounds: Size of the area drawing should be constrained to * param[in] bounds: Size of the area drawing should be constrained to
*/ */
virtual void render(display::Display *display, display::Rect bounds) = 0; virtual void render(display::Display *display, display::Rect bounds) = 0;
/** /**
* param[in] indent_depth: Depth to indent the config * param[in] indent_depth: Depth to indent the config
* param[in] additional_level_depth: If children require their config to be dumped you increment * param[in] additional_level_depth: If children require their config to be dumped you increment
* their indent_depth before calling it * their indent_depth before calling it