Is there a way to stop labels from changing position constantly in QGIS? - maps

I've been trying to figure out how to stop the labels from moving when dragging the map with the cursor. here is what happens
Is it possible to prevent this from happening?
I am new to qgis and don't really know what to try to fix this.

Related

Hover across entire window and stop where mouse pointer changes

I'm faced with an issue I do not know how to tackle. I need to implement a function in python or C that allows me to hover( with the mouse) over the entire windowed application and stop when the mouse pointer icon changes. Any help or tip as to how I can attain this will be appreciated. Thank you.

React Three Fiber: How to switch between TrackballControls and OrbitControls?

I'm trying to create a viewer in react-three-fiber with react-three/drei where I can switch between OrbitControls and TrackballControls.
The problem is that when switching from TrackballControls to OrbitControls, the axis that the camera rotates around changes as of course the TrackballControls change the up-vector when moving around.
I created a couple of minimal examples in codesandbox to explain my approach to solve this and to show where I'm stuck.
Base Case
This shows the initial attempt to switch between the different control types:
https://codesandbox.io/s/r3f-camera-controllers-base-neu07
Attempt #1
Obviously, this does not work as it is, so I tried resetting the up-vector to (0, 1, 0) and calling lookAt(). This seems to work initially as the camera reorients itself correctly (this is how it should look like). However, it does not rotate around the correct axis and instead moves in strange arcs. See here:
https://codesandbox.io/s/r3f-camera-controllers-set-up-vector-yps4k
Attempt #2
For this question it was suggested to create a new camera which I also tried but ultimately it lead to the same result. This here is my attempt at creating a new camera and copying some values to the new camera:
https://codesandbox.io/s/r3f-camera-controllers-reset-camera-3cih0
Any help appreciated. Thanks!
After a couple of days, I finally figured out a way to achieve what I want.
Instead of trying to remove the different controls, I just enable and disable them separately. I can then call the reset() functions on both Controls via a ref if the control prop changes. To retain the camera position, I can just temporarily store it before resetting the controls.
You can find an example here.

How should I add animation in this case?

I've modeled using helixtoolkit which is done in a wpf user control library and hosted on ElementHost. I decided to do this because my model is fairly simple (just a stick element with lineVisual3d and bunch of small spheres).
Now I want to animate it and everything I find related to animation seems too complicated for what I'm trying to accomplish. I've seen storyboard being suggested as well as transform methods.
What I have is a 3D line connected by a bunch of points3D and I want to translate them only by a series of values at a fixed time increment.
I did this in a 2D graph using a timer for winform and even a forloop did the trick.
However, I'm not sure how to do the same for a 3D line element. I was thinking that since I have a simple structure simply redrawing it would suffice.
But my problem is I want to add a slider which acts in pretty much the same way as a video player, it will increment itself as the animation runs, I want to also be able to freeze it at any point in time and use the slider to go to any point in time much like how a video player works.
My biggest question here is how do I use a slider to control the animation. Again, this animation will simply be a bunch of values that I want to translate the stick element by(a series of points).
I've already got the values but I want to add an animation for these values at every increment while being able to control it using a slider.
--I will post any code if necessary, not posting any right now because I dont know what would help explain the question better
You can use TranslationTransform3D and apply the transform onto the 3D Model

Save RenderCopyEx

I want to create an image processing application with SDL.
My problem is that I want to rotate a surface. I tried to write the algorithm for accessing the pixels and putting them in the right position but I get really jaggy results.For this reason,I thought that the easiest solution would be to take advantage of the SLD_RenderCopyEx.
However, as I expected, this function doesn't affect the surface but the renderer, and if I want to save the result(after rotation) I will not get the rotated version of the image. Do you guys know if there is any way of saving the image as I see it on the screen? And if not, what do you guys suggest me to do ?
You can use SDL_RenderReadPixels() to read pixels from the current rendering target.

Manually triggering a redraw on AnyMap

on mobile devices the map renders sometimes a bit buggy.. markers are moved or too big.. can't really describe what happens there, it just looks really weird. However it does fade away when I move the map a bit, so I guess they are redrawn that moment. So to do that automatically I was listening to some events and then moved the map just for a pixel.. is there some better way to trigger a redraw? as everybody can see the map moving for a pixel.
AnyIdeas?
//edit: after testing a bit more I can say that moving the map using the move method doesn't trigger a redraw, it only works if I move the map myself, e.g. by touch gesture
//edit2: for now I am using anyMap.zoom(1) for triggering that redraw, it works but seems like a hacky solution
There is a bug in 7.13.0, AnyChart team will try to fix it in 7.13.1 which is scheduled do be released in a couple of weeks. There is no good workaround at the moment, unfortunately.

Resources