stuff-from-scratch/apps/sample-gui/image_editor/ImageViewWidget.cpp

33 lines
682 B
C++
Raw Normal View History

2022-11-17 17:33:48 +00:00
#include "ImageViewWidget.h"
#include "GridNode.h"
#include "TransformNode.h"
#include <iostream>
ImageViewWidget::ImageViewWidget()
{
mName = "ImageViewWidget";
}
void ImageViewWidget::doPaint(const PaintEvent* event)
{
if (!mVisible)
{
return;
}
if (!mGridNode)
{
std::cout << "Setting up grid node" << std::endl;
mGridNode = std::make_unique<GridNode>(mLocation);
mGridNode->setName(mName + "_GridNode");
mGridNode->setNumX(mNumX);
mGridNode->setNumY(mNumY);
mGridNode->setWidth(mSize.mWidth);
mGridNode->setHeight(mSize.mHeight);
mRootNode->addChild(mGridNode.get());
}
}