diff --git a/Source/Connection.cpp b/Source/Connection.cpp index 0d80c469e..f28868609 100644 --- a/Source/Connection.cpp +++ b/Source/Connection.cpp @@ -504,7 +504,7 @@ StringArray Connection::getMessageFormated() formatedMessage.add("symbol:"); formatedMessage.add(String(args[0].getSymbol())); } else if (name == "list") { - formatedMessage.add("list:"); + formatedMessage.add("list (" + String(args.size()) + "):"); for (auto& arg : args) { if (arg.isFloat()) { formatedMessage.add(String(arg.getFloat())); diff --git a/Source/Dialogs/ConnectionMessageDisplay.h b/Source/Dialogs/ConnectionMessageDisplay.h index 11c3b0bad..a56485791 100644 --- a/Source/Dialogs/ConnectionMessageDisplay.h +++ b/Source/Dialogs/ConnectionMessageDisplay.h @@ -76,7 +76,7 @@ class ConnectionMessageDisplay auto halfEditorWidth = getParentComponent()->getWidth() / 2; auto fontStyle = haveMessage ? FontStyle::Semibold : FontStyle::Regular; - auto textFont = Font(haveMessage ? Fonts::getSemiBoldFont() : Fonts::getCurrentFont()); + auto textFont = Font(haveMessage ? Fonts::getSemiBoldFont() : Fonts::getDefaultFont()); textFont.setSizeAndStyle(14, FontStyle::Regular, 1.0f, 0.0f); int stringWidth; @@ -103,10 +103,10 @@ class ConnectionMessageDisplay messageItemsWithFormat.add(TextStringWithMetrics(stringItem, fontStyle, stringWidth)); - if (fontStyle != FontStyle::Monospace) { - // set up font for next item/s - use monospace for values / lists etc - fontStyle = FontStyle::Monospace; - textFont = Font(Fonts::getMonospaceFont()); + if (fontStyle != FontStyle::Regular) { + // set up font for next item/s -regular font to support extended character + fontStyle = FontStyle::Regular; + textFont = Font(Fonts::getDefaultFont()); } } diff --git a/Source/Object.cpp b/Source/Object.cpp index f11d0c78c..7b51b9f56 100644 --- a/Source/Object.cpp +++ b/Source/Object.cpp @@ -313,7 +313,10 @@ void Object::applyBounds() } void Object::updateBounds() { - if (gui) { + // only update if we have a gui and the object isn't been moved by the user + // otherwise PD hasn't been informed of the new position 'while' we are dragging + // so we don't need to update the bounds when an object is being interacted with + if (gui && !isObjectMouseActive) { // Get the bounds of the object in Pd auto newBounds = gui->getPdBounds(); @@ -863,6 +866,10 @@ void Object::mouseUp(MouseEvent const& e) openHelpPatch(); } + auto objects = cnv->getSelectionOfType(); + for (auto* obj : objects) + obj->isObjectMouseActive = false; + if (ds.wasResized) { cnv->objectGrid.clearAll(); @@ -969,6 +976,8 @@ void Object::mouseDrag(MouseEvent const& e) if (!obj->gui) continue; + obj->isObjectMouseActive = true; + // Create undo step when we start resizing if (!ds.wasResized) { auto* objPtr = static_cast(obj->getPointer()); @@ -1050,6 +1059,7 @@ void Object::mouseDrag(MouseEvent const& e) int i = 0; for (auto* selected : selection) { selected->originalBounds = selected->getBounds().withPosition(mouseDownObjectPositions[i]); + selected->isObjectMouseActive = true; i++; } @@ -1061,7 +1071,7 @@ void Object::mouseDrag(MouseEvent const& e) // FIXME: stop the mousedrag event from blocking the objects from redrawing, we shouldn't need to do this? JUCE bug? if (ds.componentBeingDragged) { for (auto* object : selection) { - + object->isObjectMouseActive = true; auto newPosition = object->originalBounds.getPosition() + dragDistance; object->setBufferedToImage(true); diff --git a/Source/Object.h b/Source/Object.h index f54b8cb7b..159a35b54 100644 --- a/Source/Object.h +++ b/Source/Object.h @@ -132,6 +132,8 @@ class Object : public Component bool showActiveState = false; float activeStateAlpha = 0.0f; + bool isObjectMouseActive = false; + Image activityOverlayImage; ObjectDragState& ds; diff --git a/Source/Objects/IEMHelper.h b/Source/Objects/IEMHelper.h index b631387cc..197343b9f 100644 --- a/Source/Objects/IEMHelper.h +++ b/Source/Objects/IEMHelper.h @@ -279,27 +279,28 @@ class IEMHelper { void updateLabel(std::unique_ptr& label) { - int fontHeight = getFontHeight(); - - const String text = getExpandedLabelText(); + const String text = ::getValue(labelText); if (text.isNotEmpty()) { if (!label) { label = std::make_unique(object); + object->cnv->addChildComponent(label.get()); } auto bounds = getLabelBounds(); - bounds.translate(0, fontHeight / -2.0f); + bounds.translate(0, bounds.getHeight() / -2.0f); - label->setFont(Font(fontHeight)); + label->setFont(Font(bounds.getHeight())); label->setBounds(bounds); label->setText(text, dontSendNotification); label->setColour(Label::textColourId, getLabelColour()); - object->cnv->addAndMakeVisible(label.get()); + label->setVisible(true); } else { + if (label) + label->setVisible(false); label.reset(nullptr); } }