aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ecp5/arch.h2
-rw-r--r--gui/fpgaviewwidget.cc19
2 files changed, 15 insertions, 6 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 59c8638d..ab4a4e00 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -918,7 +918,7 @@ struct Arch : BaseCtx
delay_t estimateDelay(WireId src, WireId dst) const;
delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const;
delay_t getDelayEpsilon() const { return 20; }
- delay_t getRipupDelayPenalty() const { return 250; }
+ delay_t getRipupDelayPenalty() const { return 400; }
float getDelayNS(delay_t v) const { return v * 0.001; }
DelayInfo getDelayFromNS(float ns) const
{
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index 0ad90527..ac6cd969 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -644,12 +644,16 @@ void FPGAViewWidget::mousePressEvent(QMouseEvent *event)
if (io.WantCaptureMouse)
return;
- if (event->buttons() & Qt::RightButton || event->buttons() & Qt::MidButton) {
+ bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
+ bool ctrl = QApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
+ bool btn_right = event->buttons() & Qt::RightButton;
+ bool btn_mid = event->buttons() & Qt::MidButton;
+ bool btn_left = event->buttons() & Qt::LeftButton;
+
+ if (btn_right || btn_mid || (btn_left && shift)) {
lastDragPos_ = event->pos();
}
- if (event->buttons() & Qt::LeftButton) {
- bool ctrl = QApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
-
+ if (btn_left && !shift) {
auto world = mouseToWorldCoordinates(event->x(), event->y());
auto closestOr = pickElement(world.x(), world.y());
if (!closestOr) {
@@ -681,7 +685,12 @@ void FPGAViewWidget::mouseMoveEvent(QMouseEvent *event)
if (io.WantCaptureMouse)
return;
- if (event->buttons() & Qt::RightButton || event->buttons() & Qt::MidButton) {
+ bool shift = QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
+ bool btn_right = event->buttons() & Qt::RightButton;
+ bool btn_mid = event->buttons() & Qt::MidButton;
+ bool btn_left = event->buttons() & Qt::LeftButton;
+
+ if (btn_right || btn_mid || (btn_left && shift)) {
const int dx = event->x() - lastDragPos_.x();
const int dy = event->y() - lastDragPos_.y();
lastDragPos_ = event->pos();