Browse Source

Expose SubWidget::setNeedsViewportScaling and use it in NanoWidget

Signed-off-by: falkTX <falktx@falktx.com>
pull/282/head
falkTX 4 years ago
parent
commit
471a00f4f6
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 11 additions and 2 deletions
  1. +5
    -1
      dgl/SubWidget.hpp
  2. +1
    -1
      dgl/src/NanoVG.cpp
  3. +5
    -0
      dgl/src/SubWidget.cpp

+ 5
- 1
dgl/SubWidget.hpp View File

@@ -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)
}; };




+ 1
- 1
dgl/src/NanoVG.cpp View File

@@ -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>;


+ 5
- 0
dgl/src/SubWidget.cpp View File

@@ -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;


Loading…
Cancel
Save