+ int content_height = static_cast<int>(RENDERING_HEIGHT * drawables_.size());
+ int window_height = static_cast<int>(window_->getSize().y);
+ int not_visible = std::max(0, content_height - window_height);
+ int min_scroll_position = -not_visible;
+ int max_scroll_position = 0;
+
+ scroll_position_ = std::min(max_scroll_position, std::max(min_scroll_position, scroll_position_));