diff --git a/customWidgets.cpp b/customWidgets.cpp index 00b4ca0..7654431 100644 --- a/customWidgets.cpp +++ b/customWidgets.cpp @@ -456,7 +456,7 @@ bigIconButton::bigIconButton(const QString &iconPath, const QString &description bgWidget = new QWidget(this); bgWidget->resize(this->size()); radiusStyle = QString::asprintf("border-radius:%dpx;", cornerRadius); - bgWidget->setStyleSheet(radiusStyle + "background-color:#00000000"); + bgWidget->setStyleSheet(radiusStyle + "background-color:#04000000"); bgWidget->lower(); bgWidget->show(); @@ -479,8 +479,8 @@ void bigIconButton::resizeEvent(QResizeEvent *event){ indicator->move(this->width() * 0.45, this->height() - 21); } else{ - indicator->resize(this->width() * 0.4, 6); - indicator->move(this->width() * 0.3, this->height() - 21); + indicator->resize(this->width() * 0.1, 6); + indicator->move(this->width() * 0.45, this->height() - 21); } } @@ -497,7 +497,7 @@ void bigIconButton::enterEvent(QEnterEvent *event){ } void bigIconButton::leaveEvent(QEvent *event){ - bgWidget->setStyleSheet(radiusStyle + "background-color:#00000000"); + bgWidget->setStyleSheet(radiusStyle + "background-color:#04000000"); QPropertyAnimation *shorter = new QPropertyAnimation(indicator, "geometry", this); shorter->setStartValue(indicator->geometry()); if(!onSelected) diff --git a/graph_implement.cpp b/graph_implement.cpp index 6093b4d..76e1ff8 100644 --- a/graph_implement.cpp +++ b/graph_implement.cpp @@ -482,7 +482,7 @@ void AMLGraph::DelVex(int vexID){ AMLArc *nextArc = preArc->nextOutArc; while(nextArc != nullptr){ if(nextArc->inVexID == vexID || nextArc->outVexID == vexID){ - if(preArc->outVexID == i){ + if(preArc->outVexID == i || preArc->outVexID == -i){ if(nextArc->outVexID == i){ preArc->nextOutArc = nextArc->nextOutArc; nextArc->nextOutArc = nullptr; @@ -506,20 +506,52 @@ void AMLGraph::DelVex(int vexID){ delete nextArc; } } - nextArc = preArc->outVexID == i ? preArc->nextOutArc : preArc->nextInArc; + nextArc = (preArc->outVexID == i || preArc->outVexID == -i) ? preArc->nextOutArc : preArc->nextInArc; continue; } - preArc = nextArc; - nextArc = preArc->outVexID == i ? preArc->nextOutArc : preArc->nextInArc; if(preArc->inVexID > vexID) preArc->inVexID = - preArc->inVexID; else if(preArc->inVexID < 0) - preArc->inVexID = - preArc->inVexID; + preArc->inVexID = - preArc->inVexID - 1; if(preArc->outVexID > vexID) preArc->outVexID = - preArc->outVexID; else if(preArc->outVexID < 0) - preArc->outVexID = - preArc->outVexID; + preArc->outVexID = - preArc->outVexID - 1; + preArc = nextArc; + nextArc = (preArc->outVexID == i || preArc->outVexID == -i) ? preArc->nextOutArc : preArc->nextInArc; + + /********************************************************************************************/ + //Issue #1 + /*How this causes issue: + * Example: when vexID is 1 + * preArc = nextArc => preArc: -3 -> -2 + * nextArc = ... => nextArc : 3 -> 1 + * Adjust pre Arc to => preArc: 2 -> 1 + * In next loop: nextArc->inVexID == 1 => judge if preArc->nextOutArc == 3 (in fact it is) + * preArc->nextOutArc != 3 -> wrongly connect next out arc of 3 -> 1 to next out arc of 2 -> 1 + * which leads to wrong operations + */ + + //if(preArc->inVexID > vexID) + // preArc->inVexID = - preArc->inVexID; + //else if(preArc->inVexID < 0) + // preArc->inVexID = - preArc->inVexID - 1; + //if(preArc->outVexID > vexID) + // preArc->outVexID = - preArc->outVexID; + //else if(preArc->outVexID < 0) + // preArc->outVexID = - preArc->outVexID - 1; + + /********************************************************************************************/ + } + if(preArc->inVexID > vexID) + preArc->inVexID = - preArc->inVexID; + else if(preArc->inVexID < 0) + preArc->inVexID = - preArc->inVexID - 1; + if(preArc->outVexID > vexID) + preArc->outVexID = - preArc->outVexID; + else if(preArc->outVexID < 0) + preArc->outVexID = - preArc->outVexID - 1; outVexList[i].firstArc = dummyHead->nextOutArc; delete dummyHead; } diff --git a/mainwindow.cpp b/mainwindow.cpp index 5e77620..ead9be3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -49,17 +49,21 @@ void MainWindow::Init(){ border->show(); /*****************************************************************/ - /* Create settings page */ + /* Create about page */ defaultSettingsPage = new SlidePage(cornerRadius, "ABOUT", ui->mainWidget); textInputItem *version = new textInputItem("version", defaultSettingsPage); - version->setValue("1.0"); + version->setValue("1.1 beta"); version->setEnabled(false); textInputItem *updateDate = new textInputItem("last-upd", defaultSettingsPage); - updateDate->setValue("2021/12/4"); + updateDate->setValue("2021/12/5"); updateDate->setEnabled(false); textInputItem *Author = new textInputItem("author", defaultSettingsPage); Author->setValue("Linloir | Made with love"); Author->setEnabled(false); + textInputItem *GitHub = new textInputItem("git", defaultSettingsPage); + GitHub->setValue("github.com/Linloir"); + GitHub->setEnabled(false); + defaultSettingsPage->AddContent(GitHub); defaultSettingsPage->AddContent(Author); defaultSettingsPage->AddContent(updateDate); defaultSettingsPage->AddContent(version); diff --git a/mainwindow.h b/mainwindow.h index f6b9daf..da435bc 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -48,7 +48,7 @@ private: QPoint lastPos; void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event){mousePressed = false;} + void mouseReleaseEvent(QMouseEvent *event){mousePressed = false;if(event->globalPosition().y() < 2) controlWindowScale();} void resizeEvent(QResizeEvent *event); bool maximized = false;