mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-18 22:30:30 +02:00
basics of zoom and scroll
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
|
||||
: QWidget(parent){
|
||||
: QLabel(parent){
|
||||
this->Tool = nullptr;
|
||||
this->setLayerDimensions(maxWidth, maxHeight);
|
||||
|
||||
@@ -120,7 +120,7 @@ void PaintingArea::setPolygon(int idx){
|
||||
delete this->Tool;
|
||||
this->Tool = new IntelliToolPolygon(this,&colorPicker,&Toolsettings, true);
|
||||
isSettingPolygon = true;
|
||||
this->DummyGui->setToolWidth(5);
|
||||
this->guiReference->setToolWidth(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void PaintingArea::moveActiveLayer(int idx){
|
||||
}else if(idx==-1) {
|
||||
this->selectLayerDown();
|
||||
}
|
||||
DummyGui->UpdateGui();
|
||||
guiReference->UpdateGui();
|
||||
}
|
||||
|
||||
void PaintingArea::slotActivateLayer(int a){
|
||||
@@ -322,11 +322,16 @@ void PaintingArea::wheelEvent(QWheelEvent*event){
|
||||
// The QPaintEvent is sent to widgets that need to
|
||||
// update themselves
|
||||
void PaintingArea::paintEvent(QPaintEvent*event){
|
||||
this->setFixedSize(QSize(maxWidth,maxHeight));
|
||||
this->drawLayers();
|
||||
|
||||
QPainter painter(this);
|
||||
QRect dirtyRec = event->rect();
|
||||
painter.drawImage(dirtyRec, *Canvas, dirtyRec);
|
||||
QPainter painter(this);
|
||||
|
||||
//insert zoom factor here
|
||||
painter.scale(1,1);
|
||||
|
||||
//calulate image here for scroll
|
||||
painter.drawImage(0,0, *Canvas);
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ struct LayerObject {
|
||||
/*!
|
||||
* \brief The PaintingArea class manages the methods and stores information about the current painting area, which is the currently opened project
|
||||
*/
|
||||
class PaintingArea : public QWidget
|
||||
class PaintingArea : public QLabel
|
||||
{
|
||||
friend UnitTest;
|
||||
// Declares our class as a QObject which is the base class
|
||||
@@ -228,6 +228,7 @@ void selectLayerDown();
|
||||
IntelliTool* copyActiveTool();
|
||||
|
||||
QImage* Canvas;
|
||||
QImage ScaledCanvas;
|
||||
int maxWidth;
|
||||
int maxHeight;
|
||||
|
||||
@@ -235,7 +236,7 @@ bool isSettingPolygon = false;
|
||||
|
||||
IntelliRenderSettings renderSettings;
|
||||
IntelliTool* Tool;
|
||||
IntelliPhotoGui* DummyGui;
|
||||
IntelliPhotoGui* guiReference;
|
||||
|
||||
std::vector<LayerObject> layerBundle;
|
||||
int activeLayer = -1;
|
||||
|
||||
Reference in New Issue
Block a user