draw control - position of the circle and rectangle buttons - leaflet.draw

the leaflet-draw draw control has the "draw circle" button below the "draw rectangle". Can I switch them so that the "Draw Circle" is above the "Draw Rectangle"?

I think the easiest way to do this would be to use a local version of leaflet-draw and change the source code around a bit, try moving the circle above the other options in this file.

Related

ggez resize window without distording drawn elements

I use ggez and would like to resize the window. The only way I found is
graphics::set_drawable_size(&mut ctx, width, height);
However, when I use it, the white circle I drawn turns into a white ellipse, and a seemingly grey circle appears below. So is there another way of resizing window, one that doesn't distort what is drawn ?
use
graphics::set_screen_coordinates(ctx,rect)
right after declaring changing size with graphics::set_mode(ctx,windowmode) turns the ellipse back into a circle. The gray shape vanishes after reducing the window (this is a pretty obscure thing).

How do I create the center of TouchScreenButton texture in the center of the TouchScreenButton position along with it's shape?

So, if I create a button using TouchScreenButton and assign a texture to it, the texture will be displayed on the left bottom of the TouchScreenButton position (See image below)
The TouchScreenButton position is in the top left corner of the rectable
When I don't assign a texture and instead I create a sprite as the child node and assign a texture to it, it will display the texture in the center of TouchScreenButton.
But the shape is still follows what I have said earlier.
My question, How do I create the center of TouchScreenButton texture in the center of the TouchScreenButton position along with it's shape? I want the TouchScreenButton is in the middle of the TouchScreenButton texture.
Solution 1. Go to your Sprite node and in the inspector disable Centered property in the offset section. This way though you should keep sprite and shape sizes for centers of the area and the texture to match, coz now both the Sprite and Shape will be to the right bottom of the origin coordinates of the button.
Solution 2. Go to your TouchScreenButton node and in the inspector enable Shape Centered property in the main section. This way you will make both the shape and the sprite to be centered in the origin of the button.

Re-scaling x, y-axis on capture correct coordinate scale on mouse-over in matplotlib

I am rendering a data as shown below using cluster analysis.
As you can see that ports in the range of 0-200 are clubbed together. Is there a way to zoom in on the scale when I mouse over a coordinate and thereby redrawing that section of the graph again in a zoomed window. What i mean is that for the coordinates shown in blue circle, when I mouse over, I want the x, y axis redrawn for 0-10000 using a different scale so that overlapping circles move apart. Is it possible ?. I must confess I find matplotlib little challenging and my apologies if my question is little cryptic. thanks for the help!
Assuming youre using pyplot then this functionality is built right in to the pyplot output.
See the following from the matplotlib documentation.
The Zoom-to-rectangle button
Click this toolbar button to activate this mode. Put your mouse somewhere over an axes and press the left mouse button. Drag the mouse while holding the button to a new location and release. The axes view limits will be zoomed to the rectangle you have defined. There is also an experimental ‘zoom out to rectangle’ in this mode with the right button, which will place your entire axes in the region defined by the zoom out rectangle.
If you need to enable zoom to rectangle functionality without actually clicking then this will be possible by creating a transparent figure positioned in a location of your choice on your plot and then initiating a matplotlib event to be handled when the mouse hovers over this area. This functionality is not built in and will require customisation.
Detail relating to event handling on mouseover events can be found at this URL

VTK move image to center of the bounding box

How can I move my image which is in the bottom left of the bounding box to center of the box? Also I want to maximize the size of the image that fits to the bounding box.
What do you mean by "bounding box"? If you are using a vtkImageSlice, you can just use SetPosition(-width/2, -height/2, 0).

How to prevent OnCustomDraw of CTreeCtrl from painting Default painting on my painting

I created a CTreeCtrl but I need to mark some of the items in red colored hollow box.
So I created the function OnCustomDraw and drew a red colour box around the item. The red box is appearing but the text part and image parts are drawn on top of the red box so some part of the box cannot be seen. I guess the default painting is overriding my painting. Can anyone tell me how my painting will be over the default painting.
I assume you should be painting on the correct stage. CDDS_ITEMPOSTPAINT seems to be a good choice. Here you would find more information on that.
You should insert an item (your draw possibly as a bitmap and your text as well) instead of updating just your draw.

Resources