summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Belt <andrewpbelt@gmail.com>2023-01-19 09:07:57 -0500
committerAndrew Belt <andrewpbelt@gmail.com>2023-01-19 09:07:57 -0500
commita5e377f2e6dc258bba6a472f2ec449f80ad15d40 (patch)
treeace495ef861461fd7a67fde9b0ddb0eba6f6de7f /include
parenta7492aa4122bc1329b079cb78e8e1b0aaa30683a (diff)
When cloning, pasting, or importing module selection, place modules nearest to center of rack viewport.
Diffstat (limited to 'include')
-rw-r--r--include/ui/ScrollWidget.hpp3
-rw-r--r--include/widget/Widget.hpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/ui/ScrollWidget.hpp b/include/ui/ScrollWidget.hpp
index 63c3c4c9..2f7ed2a2 100644
--- a/include/ui/ScrollWidget.hpp
+++ b/include/ui/ScrollWidget.hpp
@@ -23,6 +23,9 @@ struct ScrollWidget : widget::OpaqueWidget {
ScrollWidget();
~ScrollWidget();
+ math::Vec getScrollOffset() {
+ return offset;
+ }
void scrollTo(math::Rect r);
/** Returns the bound of allowed `offset` values in pixels. */
math::Rect getContainerOffsetBound();
diff --git a/include/widget/Widget.hpp b/include/widget/Widget.hpp
index 68c93fcf..0e9ef0f2 100644
--- a/include/widget/Widget.hpp
+++ b/include/widget/Widget.hpp
@@ -85,7 +85,7 @@ struct Widget : WeakBase {
}
/** Returns a subset of the given Rect bounded by the box of this widget and all ancestors.
*/
- virtual math::Rect getViewport(math::Rect r);
+ virtual math::Rect getViewport(math::Rect r = math::Rect::inf());
template <class T>
T* getAncestorOfType() {