47 lines
988 B
C++
47 lines
988 B
C++
#include "ImageViewWidget.h"
|
|
|
|
#include "GridNode.h"
|
|
#include "TransformNode.h"
|
|
|
|
#include <iostream>
|
|
|
|
ImageViewWidget::ImageViewWidget()
|
|
{
|
|
std::cout << "Creating image view widget" << std::endl;
|
|
mName = "ImageViewWidget";
|
|
}
|
|
|
|
void ImageViewWidget::doPaint(const PaintEvent* event)
|
|
{
|
|
if (!mVisible)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!mGridNode)
|
|
{
|
|
mGridNode = std::make_unique<GridNode>(mLocation);
|
|
mGridNode->setName(mName + "_GridNode");
|
|
mGridNode->setNumX(mNumX);
|
|
mGridNode->setNumY(mNumY);
|
|
|
|
mGridNode->setWidth(mSize.mWidth);
|
|
mGridNode->setHeight(mSize.mHeight);
|
|
|
|
mGridNode->setStrokeColor(mBorderColor);
|
|
|
|
mRootNode->addChild(mGridNode.get());
|
|
}
|
|
|
|
if (mTransformDirty)
|
|
{
|
|
mGridNode->setLocation(mLocation);
|
|
mGridNode->setWidth(mSize.mWidth);
|
|
mGridNode->setHeight(mSize.mHeight);
|
|
}
|
|
|
|
if (mMaterialDirty)
|
|
{
|
|
mGridNode->setFillColor(mBorderColor);
|
|
}
|
|
}
|