bus joint paint now configured with BlockView::setBusSquareNodes(), square or round. By default round
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <QVector2D>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
const QString _BlockView_Mime_ = "_BlockView_copypaste_";
|
||||
|
||||
@@ -45,9 +46,9 @@ void BlockView::_init() {
|
||||
smode = BlockView::MultiSelection;
|
||||
cur_scl = thumb_scl = prev_app_scale = 1.;
|
||||
_talpha = 0.;
|
||||
ae_enabled = is_block_anim = true;
|
||||
is_nav_anim = true;
|
||||
ae_enabled = is_block_anim = is_nav_anim = true;
|
||||
nav_prev_aa = nav_prev_imaa = nav_prev_grid = true;
|
||||
square_node = false;
|
||||
thumb_size = QSizeF(200, 200);
|
||||
if (scene() == 0) {
|
||||
scene_ = new QGraphicsScene;
|
||||
@@ -938,6 +939,7 @@ void BlockView::addItem(QGraphicsItem * item, bool emit_action) {
|
||||
applyGridStep();
|
||||
if (item->data(1005) == "connection") {
|
||||
loadBus(qgraphicsitem_cast<BlockBusItem*>(item));
|
||||
((BlockBusItem*)item)->setSquareNodes(square_node);
|
||||
connect((BlockBusItem*)item, SIGNAL(destroyed(QObject*)), this, SLOT(removedBus(QObject*)), Qt::UniqueConnection);
|
||||
if (emit_action) emitActionEvent(BlockItemBase::BusAdd, QList<QGraphicsItem*>() << item);
|
||||
emit connectionsChanged();
|
||||
@@ -1236,7 +1238,7 @@ void BlockView::trace(QPointF scene_pos_from, QPointF scene_pos_to, BlockBusItem
|
||||
int dx = sr.left() / grid_step, dy = sr.top() / grid_step;
|
||||
//qDebug() << dp;
|
||||
QPoint dp(-dx, -dy), qpt = quantize(scene_pos_to, grid_step).toPoint() / grid_step + dp;
|
||||
QTime tm;
|
||||
QElapsedTimer tm;
|
||||
tm.restart();
|
||||
wavetrace.resize(sr.size() / grid_step);
|
||||
wavetrace.fill(BlockViewWavetrace::Empty);
|
||||
@@ -1719,6 +1721,15 @@ void BlockView::checkPaste(bool queued) {
|
||||
}
|
||||
|
||||
|
||||
void BlockView::setBusSquareNodes(bool yes) {
|
||||
square_node = yes;
|
||||
QList<BlockBusItem * > sbl = buses();
|
||||
foreach (BlockBusItem * b, sbl) {
|
||||
b->setSquareNodes(square_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BlockView::newBranchTrace(BlockBusItem * item, QPointF to) {
|
||||
trace(item->press_pos, to, &tmp_bus);
|
||||
|
||||
Reference in New Issue
Block a user