Force using specific node for connection in diagrams.net - draw.io

Sorry if it isn't the best place to ask about draw.io, but I'm really stuck here.
It seems to be new addition, because it was working just fine a few months ago.
When I try to connect two objects, it changes node on its own to make connection shorter, even if it clips with other objects.
Here is what I'm trying to do (it won't let me though):
Here is what diagrams.net does instead:
It's one of these moments where software tries to be smarter than the user and fails miserably.
Is there a way to bypass it, or I just should find alternative website?

Well, not sure where you have the problem. I get the same behaviour as in your second screenshot but by moving the anchor of the line, I get what you have in the first screenshot.
See animated GIF:

Related

Swiftui set boundaries for drag and drop, based on color

I am using the latest swiftui and would like to know if it is possible to create drag & drop boundaries based on color?
I already created a drag & drop with rotation, pinching, etc. But would like to be able to create regions where you can drop into.
Thanks
Yes it is! It's a great idea, and I think you should pursue it.
As it stands there's a hundred different ways to go about things. Spend some time thinking about how you would want it to work, then just take baby steps. You've already covered a lot of the ground work by implementing rotation and pinching.
Write some code (in a playground so you get instant feedback) that does some simple drag and drop work. Add in a line of code that turns the background a different color or changes its opacity when you let go/lift your finger.
Those types of incremental changes are well documented and you will be able to google them quickly. I think it's a great sign that you haven't found ready made examples. It means you are thinking outside the box.
This is an opportunity for you to think like a developer and a designer. If you post your results somewhere or release a project on GitHub at some point, others will be able to find your work using the same search criteria you used when you didn't find any results.
If you get stuck, post the code the code that has you baffled, and I'm sure you get help on this site. Best of luck 🍀

Image (Numbers/Letters) recognition

I'm learning C++ for half a year now (so programming in general) and this site always had the answers I was looking for. But now I came to the point where I need to ask as I couldn't find anything related to my question.
So I want to write a program that takes a screenshot of a particular area of the screen. This screenshot will ONLY contain playcards (so for example Hearth, Seven). What it should do now is return me which card it is, so the symbol and the number/letter.
I already made some researches and the most mentioned thing was the library "OpenCV".
So my question now: First is it even possible with my experience to write something like that?
If so, is this library the way to go? It seems really strong, maybe too strong for just the recognition of numbers/letters and four symbols? So could there be something easier?
And the last question, how could I get a screenshot of a particular area of the screen and not the whole screen and save it somewhere?
I hope you guys have a clue what I really want to know and it was understandable.
Greetings
Definitely use OpenCV. It is not too hard to get into, and once you do you will find it does basically everything you'd want. It makes image processing relatively straightforward and it can solve your problem in a lot of ways.
Here is a good place to start.

Node graph editor layout algorithm

I'm very much trying to do what was asked here:
http://www.qtcentre.org/threads/45028-Designing-a-Node-Editor-(Hint-Blender-Node-Editor)
Which is basically a blender style node editor using Qt. Creating rects with circles which can be drag/dropped is fairly simple to figure out (see the image below).
The issue I have is how the algorithm for connecting the circles between nodes would work. Also I don't know how this could be drawn efficiently using QGraphicsItem API's? I have seen QPainter::cubicTo() which looks like it may be the way to go?
I assume it somehow manages to find a none overlapping path? But it must also handle the case where it has to overlap?
And what about the user being able to move these lines around in case the algorithm has done a bad job? I don't think this would be simple to implement using QPainter::cubicTo() as you could only move the curves control points?
I don't think you'll get anyone posting the code for doing the whole lot here.
Well, I volunteer -- just in case someone still needs such a library.
It is a Qt-based node editor implemented on top of QGraphicsView.
A library consumer defines data models, the rest is done by the node editor.
Some features:
Model-view approach.
Models describe data types, number of input and outputs and optional embedded QWidget.
The Scene could be saved to file.
The rest similar projects were either not finished, not supported anymore or lacking some features.
https://github.com/paceholder/nodeeditor
I would suggest that you implement it without taking into consideration overlap but with the possibility of overriding how the connecting line is drawn.
It looks like there were some good replies on the Qt forum. I don't think you'll get anyone posting the code for doing the whole lot here.
Perhaps take a look at the Qt demos Graphics View/Elastic Nodes - There is code for the demo that you can use as a starting point, but it is a lot of work to get from there to something like the Blender node editor.
Another node editor to take a look at is SynthEdit or Synth Maker (has a nice one).

Animated gif pauses when ember.js objects are loading

Having a problem with a spinner actually spinning while ember.js is doing it's thing. I have a very generic jsfiddle example that illustrates the issue:
http://jsfiddle.net/h4ZcZ/2/
I assume there has to be a simple way to make this work as expected, but I am not finding it. I have tried using a JavaScript/CSS implementation of a spinner (spin.js) with the same results. I saw some stuff indicating this was typically an IE issue, but that is not the case here. This happens on all browser on Windows and i have tested on Mac Safari as well.
The problem is your for loop--you're basically locking up the thread. I would use timeouts and chunk up the work to be done to give other processing needs on the page the ability to execute.
As far as root cause, #ChristopherSwasey is correct. I asked a few other Ember developers about this. No solution, but two interesting thoughts that might help:
1) One developer reported that he has run into this problem and gotten around it by making sure the animated gif started before the long javascript execution.
2) Another developer suggested that using a virtualized list is the right path, so that only visible nodes are rendered. However, I'm afraid I don't know of an open source Ember virtualized list class yet.
Hope that helps.

avoid printscreen function rendering texts

I´m looking to implement a way to avoid the user taking a screenshot from one desktop application. Yes, this seems to be weird asking for that, but we need it. I tried to use OpenGL (SDL_tff) to render the text, but it seems that doesn't stop the user from taking the screenshot. Please, does anybody have some clever idea about how to do it?
Render it to video and use a hardware overlay. those are much more difficult to capture since they are technically never rendered to the screen like other apps. It goes directly to the hardware and displays through the graphics card, bypassing normal screen shot domain.
It is still grab-able though.
personally, i'd take a high res photo and run it through a img2txt converter :D
Edit: check out http://www.gamedev.net/community/forums/topic.asp?topic_id=359319 , they seem to have an example, and it specifically states how a "screenshot" of the effect is kinda silly.
As I mentioned in my comment, you can't stop the user from taking a screenshot.
There might be a few things you can do to make it a bit more difficult though, and maybe deter less knowledgeable or driven individuals from taking a screenshot.
A suggestion: you might want to watch for key combinations that are often used for taking screenshots, then briefly hide your text. It may get the behavior that it seems you are looking for: allowing the user to take a screenshot without showing the text.
Another alternative is to provide a very easy and obvious way to let the application take the screenshot FOR the user, without saving the text. This might be useful in the case that you aren't trying to make the text "impossible" to capture, but rather that the user would prefer the screenshots to be text-free.
It's not clear from your question what the motivation behind your request is. If you just would like to have "prettier" screenshots without text, this shouldn't be a hard problem to solve: just do as I mentioned before and provide a built-in mechanism for saving "clean" screenshots.
Just remember that if the user DOES want to save that text, you cannot stop them from doing it.
You cannot accomplish what you want. What you want is, in fact, nonsensical.
Even if you find some clever way to stop them doing it with their computer,
using a good quality digital camera to take a picture of their monitor provides
a remarkably good quality screenshot.
Don't forget to add VM detection routines so you can disable display if you discover you're running under a virtual machine. That way they can't take a screenshot of the VM window.
Unless they modify an open VM to remove that sort of easy tell-tale, in which case you'll have to use something stronger.