strange moving knobs and ports in v2 and how to avoid this

3 Likes

I did not understand either the problem or the solution. Is there some bug that should be reported?

The Problem: If your zoom-factor is set to something idifferent that 50% or 100% or 200%, then after moving a module from one position to the other it can happen that knobs and/or ports were moved a pixel to the left/right relatively to the module and/or to each other.

This movement of GUI-elements takes place after dragging the module and so after releasing the mouse-button, and therefore looks strange/weird to me.

At the moment I try to understand what exactly is going on after releasing the mouse-button, and in the video above I showed my “first solution”.

But in the meantime I discovered that when I take a screenshot before I move the module and another screenshot after the move is completed, both overlap perfectly.

That means at the end no knob/port has moved relatively to the other, but it look so.

Whereas in my “first solution” knob/ports do move relatively to the other, but it does not look so.

That’s strange and I need to do more research on this “optical illusion” before I can tell if there’s a bug or not.

Ok. Thx!

I found what I was looking for:

When start dragging a module, dirtyOnSubpixelsChange is set to false.

By setting this to true, the strange visual effects disappear completely.

void ModuleWidget::onDragStart(const DragStartEvent& e) {
	if (e.button == GLFW_MOUSE_BUTTON_LEFT) {
		// HACK Disable FramebufferWidget redrawing subpixels while dragging
		APP->window->fbDirtyOnSubpixelChange() = false;

		// Clear dragRack so dragging in not enabled until mouse is moved a bit.
		internal->dragRackPos = math::Vec(NAN, NAN);

		// Prepare initial position of modules for history.
		APP->scene->rack->updateModuleOldPositions();
	}
}

Is it a bug? Probably not, because the comment above says “HACK”.

3 Likes

I say bug.

Presumably this is intended as a efficiency saving.

If it is for efficiency, then maybe a switch in the settings.json would be useful.

1 Like

This has been the case for me ever since Rack 1.0. I learned to live with the wobblies, but yeah, it looks funny sometimes.