Commit ed4aaf35 authored by Timothée Giet's avatar Timothée Giet

Revert "Fix frame selection broken due to frame dragging."

This reverts commit ba505b0b2f419fcac2d63cb0ad99bf1faa5d1141.
parent 3cf7bfca
......@@ -27,7 +27,6 @@ KisAnimationFrame::KisAnimationFrame(KisLayerContents *parent, int type, int wid
this->m_width = width;
this->setParent(parent);
this->m_parent = parent;
m_dragging = false;
}
void KisAnimationFrame::paintEvent(QPaintEvent *event)
......@@ -58,7 +57,9 @@ void KisAnimationFrame::mouseMoveEvent(QMouseEvent *event)
{
if(m_mousePressed) {
m_dragging = true;
if(this->m_type == KisAnimationFrame::SELECTION) {
return;
}
int x = event->globalX();
......@@ -77,21 +78,13 @@ void KisAnimationFrame::mousePressEvent(QMouseEvent *event)
void KisAnimationFrame::mouseReleaseEvent(QMouseEvent *event)
{
m_mousePressed = false;
m_mousePressEndPoint = event->globalX();
if(m_dragging) {
m_dragging = false;
m_mousePressEndPoint = event->globalX();
int x = (this->geometry().x() / 10);
x *= 10;
m_startPoint = x;
this->setGeometry(x, this->y(), this->width(), this->height());
}
int x = (this->geometry().x() / 10);
x *= 10;
m_parent->mouseReleased(this->x() + event->x());
m_startPoint = x;
this->setGeometry(x, this->y(), this->width(), this->height());
}
int KisAnimationFrame::getWidth()
......
......@@ -71,7 +71,6 @@ private:
int m_mousePressStartPoint;
int m_mousePressEndPoint;
int m_startPoint;
bool m_dragging;
};
#endif // KIS_ANIMATION_FRAME_H
......@@ -78,12 +78,6 @@ void KisLayerContents::mouseReleaseEvent(QMouseEvent *event)
this->m_parent->setSelectedFrame(x, this);
}
void KisLayerContents::mouseReleased(int x)
{
x = x - (x % 10);
m_parent->setSelectedFrame(x, this);
}
void KisLayerContents::mapFrame(int frameNumber, KisAnimationFrame *frame)
{
if(this->m_frames.contains(frameNumber)) {
......
......@@ -55,8 +55,6 @@ public:
KisFrameBox* getParent();
int getLayerIndex();
void mouseReleased(int x);
protected:
void paintEvent(QPaintEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment