Signed-off-by: falkTX <falktx@falktx.com>pull/282/head
@@ -126,6 +126,11 @@ public: | |||||
*/ | */ | ||||
void setNeedsFullViewportDrawing(bool needsFullViewportForDrawing = true); | void setNeedsFullViewportDrawing(bool needsFullViewportForDrawing = true); | ||||
/** | |||||
Indicate that this subwidget will always draw at its own internal size and needs scaling to fit target size. | |||||
*/ | |||||
void setNeedsViewportScaling(bool needsViewportScaling = true); | |||||
/** | /** | ||||
Indicate that this subwidget should not be drawn on screen, typically because it is managed by something else. | Indicate that this subwidget should not be drawn on screen, typically because it is managed by something else. | ||||
*/ | */ | ||||
@@ -141,7 +146,6 @@ private: | |||||
struct PrivateData; | struct PrivateData; | ||||
PrivateData* const pData; | PrivateData* const pData; | ||||
friend class Widget; | friend class Widget; | ||||
template <class BaseWidget> friend class NanoBaseWidget; | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SubWidget) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SubWidget) | ||||
}; | }; | ||||
@@ -945,7 +945,7 @@ NanoBaseWidget<SubWidget>::NanoBaseWidget(Widget* const parent, int flags) | |||||
: SubWidget(parent), | : SubWidget(parent), | ||||
NanoVG(flags) | NanoVG(flags) | ||||
{ | { | ||||
pData->needsViewportScaling = true; | |||||
setNeedsViewportScaling(); | |||||
} | } | ||||
template class NanoBaseWidget<SubWidget>; | template class NanoBaseWidget<SubWidget>; | ||||
@@ -123,6 +123,11 @@ void SubWidget::setNeedsFullViewportDrawing(const bool needsFullViewportForDrawi | |||||
pData->needsFullViewportForDrawing = needsFullViewportForDrawing; | pData->needsFullViewportForDrawing = needsFullViewportForDrawing; | ||||
} | } | ||||
void SubWidget::setNeedsViewportScaling(const bool needsViewportScaling) | |||||
{ | |||||
pData->needsViewportScaling = needsViewportScaling; | |||||
} | |||||
void SubWidget::setSkipDrawing(const bool skipDrawing) | void SubWidget::setSkipDrawing(const bool skipDrawing) | ||||
{ | { | ||||
pData->skipDrawing = skipDrawing; | pData->skipDrawing = skipDrawing; | ||||