Fabricjs - Shift + Click not selecting more than one object on canvas - fabricjs

Running fabricjs 3
I'm playing around with fabricjs, which is great. However, I'm at a point where I can no longer Shift + Click to select multiple objects. I've tried calling canvas.renderAll(). I can still select a single object and move it around. I can programatically select multiple objects and group them, but at some point in my playing around the ability to Shift + Click stopped working.
Assuming that the state of my canvas and fabricjs needs to be updated or rendered somehow or reset something? Any ideas?

Related

Umbrello wont create relation

I am trying to add an aggregation relation from 'Property' -> 'ConsumerPropertySelected' object, but it wont add any type of relation. (See the image)
If I invert the direction ('ConsumerPropertySelection' -> Property) then it adds a relation but the aggregation diamond is pointing in the wrong direction
(Currenlty I pick the relation from the toolbar and drag it between 2 objects, which worked for all the other relations... Not sure if there is a different way to do it or some setting I am missing)
This looks like a bug, however there is a workaround.
Select the relation you want from the toolbar.
Left Click and hold on the first object(ex: 'Property')
Whilst still holding the left mouse button, drag the cursor to the second object (ex: 'ConsumerPropertySelected')
Release your left mouse button over the second object
and finally click the second object again with your left mouse button
If it doesn't work the first time, try it again and it should create it... Hopefully this bug will get fixed soon
EDIT:
Looks like the bug is fixed: https://cgit.kde.org/umbrello.git/commit/?id=42d5073216f6801fef68dd6a4508b9a0e1f67ef1
The fix will probably be deployed with the next release

Xcode 10 - how to pin UI element library window?

I'm laying out UI on a storyboard using the new, controversial library button which has been moved up.
This is driving me crazy - I want to be able to "PIN" this window to a secondary monitor so I can always see available components as opposing to having to click that button every single time I need an element. Currently it disappears, even on secondary monitor once I shift focus to the view controller on screen.
How do I pin the UI Elements library to be able to always see it ?
You can press the option button in keyboard and click in the library window, it's will hold
Picture of library windown

Fabic.js grouped items are offset

So, I'm pretty much trying to just select a couple of objects by selecting them and activating a grouping function. So far, everything works right, If I move the grouped items, they move correctly, but the moment I release focus on the group, it gets offsets.
The objects are in one part of the canvas and the selectable area is in another. I already tried setCords() after the group is added and rendered, but no luck
You can see the issue in this fiddle, just select the 2 squares with the mouse and press the "Create Group" button
The problem is with the setActiveGroup method. There are two ways you can fix it:
Just try removing setActiveGroup if you don't need newly formed group to be selected and it will work as expected.
Use setActiveObject instead of setActiveGroup to set group as active. Fiddle: http://jsfiddle.net/3z19qj11/
This seems to be a bug with setActiveGroup method. I tried this with the latest version of fabric.js (1.4.13) because lot of group related bugs are fixed in each version, but this seems to be broken in latest version as well.

How do I make a circle move on events?

I'm pretty new to javafx so I'm trying to learn here so please be reasonable and don't dis away my question, I really appreciate any help at all, thanks!
I would like to know how I could move an object, let's say this circle on different events, like keypress or mouseclick, mousemove, whatever.
Circle circle = new Circle();
circle.setCenterX(100.0f);
circle.setCenterY(100.0f);
circle.setRadius(50.0f);
Do I need to use that KeyFrame thing I saw on the javafx site tutorial, or how does this work?
I would not have asked this here if I weren't feeling so lost, honestly.
So to make this clear: What is the code for moving objects that I created, by using events?
EDIT: By moving it I mean, press up key and it moves up by a few pixels, transform it maybe, with another key, or click somewhere on the scene and make it move there instantly or travel there with a certain speed. I don't have to redraw it like you need to with html5 canvas, I hope, right?
I don't have to redraw it like you need to with html5 canvas, I hope, right?
Not if you are using a standard JavaFX scene graph as opposed to a JavaFX canvas.
I would like to know how I could move an object, let's say this circle on different events, like keypress or mouseclick, mousemove, whatever
There are three ways to move a Shape:
You can adjust the shape's geometry (e.g. the centerX/centerY properties of a circle).
You can adjust the shape's layout (e.g. it's layoutX/layoutY properties).
You can adjust the shape's translation (e.g. it's translateX/translateY properties).
You can think of the layout as the home position for the object; i.e. where it should normally be in the context of it's parent group. You can think of it's translation transform as a temporary position for an object (often used when the object is being animated).
If you are using a layout pane such as a VBox or TilePane, then the layout pane will handle setting the layout co-ordinates of the child node for you. If you are using a simple Group or a plain Pane or Region, then you are responsible for setting the correct layout values for the child nodes.
To listen for events, set event handlers on Nodes or Scenes.
Here is a small sample app which demonstrates the above. It places the object to be moved inside a Group and modifies the position of the object within a Group in response to various events.

Silverlight 3 - Elements inside an element dont arrange sometimes

I have a grid/canvas that has an element (say an icon with an image and text overlayed) added to it dynamically via code.
Most of the time it renders correctly when added (content is aligned properly inside it),
but sometimes all the content sits in one corner.
I can remove/add/remove/add/remove/add and it will eventually do it
After a movement of the parent canvas, the element corrects itself as if the layout has been updated.
I have tried the following on Loaded and OnApplyTemplate for both the element and the element parent but it still seems to happen occasionally
InvalidateMeasure()
InvalidateArrange()
UpdateLayout()
Any ideas on why the content wouldn't arrange would be appreciated cause its driving me nuts
I'm not sure why it works for you sometimes but not others. But a grid has the inherent ability to dynamically resize itself and its contents. A canvas doesn't (you'd have to handle that manually in code).
If you change your canvas to a grid does it work? A grid has slightly more overhead than a canvas but it sounds to me like you need its functionality anyway.

Resources