Is there a way to change position of transformer anchors so that I can interact with transformer using mousemove but from outside of transformer box? - konvajs

For example need to use rotate anchor from another position then default top center of transformer
I have tried to create new Konva.Rect and pass its 'mousedown' and 'mousemove' events to transformer _handleMouseMove but didn't find appropriate way for it to work correctly.

Related

How to style the transform anchors on a Konva element?

How do I style the transform anchors (e.g., blue boxes) on a transformable Konva element? Note I'm using Konva with konva-react.
Example 1:
In other words, what if I wanted to make the boxes grey, and semi-transparent? Or change the size?
Example 2:
Or, what if I waned to remove the anchors and make the entire edge of a Rect able to be grabbed to resize? In other words, make the anchor transparent and full-height/full-width.
I’d start your research using the elements from this example:
https://konvajs.org/docs/sandbox/Image_Resize.html
It shows that the transformer has various bits you can style in your own way. Good luck with that.

Change bokeh python hovertool tooltip layout

Is there a way to change the layout of the hovertool's tooltips? I mean, bokeh shows the standard square with some information, close to the point and linked by a small triangle.. Is there a way to change this triangle and put a line that connects the tooltip to the point but at some distance (like an annotation), but dynamic as a hovertool tooltip?
Thanks for all!!
standard tooltip
New tooltip type
It is possible but it requires quite some work. You have to create a custom subclass of Tooltip that renders the tooltip the way you want and a custom subclass of HoverTool that uses that tooltip class.

What is the diffrence between ShapeBorderClipper class and CustomClipper<T> class

I wanted to know what is the diffrence between ShapeBorderClipper class and CustomClipper class and when is the best to use each one of them
ShapeBorderClipper is a special type of CustomClipper, which according to its documentation clips to the outer path of a ShapeBorder. And as you know CustomClipper is used to customize the clipping behavior of clip widgets such as ClipRRect and ClipOval.
As for when it is suitable to use each one you should opt for CustomClipper when you want to alter the behavior of a Clip widget. and use ShapeBorderClipper if you want to a new shape based on the mix of the current widget border and the ShapeBorder provided to ShapeBorderClipper.

Get HTML element by position

I am using TWebBrowser in Delphi.
I need help to get an HTML element by its position.
The element I need is in a frame. Using elementFromPoint():
Document.elementFromPoint(X, Y)
I am getting the frame itself, but not what is inside of it.
I tried to get it using this:
WebBrowser.OleObject.Document.Frames
But this gives me an access error when transferring frames.
Using Document.elementFromPoint() is the correct approach. What you are not taking into account is that the HTML is parsed in a hierarchical DOM tree and elementFromPoint() is not recursive.
You are asking the browser's top-level Document to find an immediate child element at a given X,Y coordinate within the Document. In this case, that is a frame element.
A frame is an embedded window that holds another Document. You need to access the frame's Document and ask it to find a child element at the target X,Y coordinate within the frame. And so on, and so on, until you finally reach the bottom-most child.
Note that elementFromPoint() takes client coordinates that are relative to the top-left corner of the Document you are calling elementFromPoint() on. So, when you want to search a child frame's Document, you need to first subtract the frame's own top-left X,Y coordinate (within its parent Document) from the target X,Y coordinate before calling elementFromPoint() on the frame's Document.

Rotated text with OpenVG

I've noticed that the OpenVG transformation matrix is ignored by the text rendering routine at all and I cannot control the text position with it manually with VG_GLYPH_ORIGIN parameter.
I'm implementing a scene graph. I found out that I can use vgGetMatrix, read components 6 and 7 of the current 3x3 transform matrix and set VG_GLYPH_ORIGIN to those values before drawing a block of text. This allows the text origin to be placed in correct place, but the text is still always displayed left-to-right.
However, this itself doesn't enable me to do any other transformations, like rotation. I'm surprised because the text is composed from VGPaths and they are indeed transformed
Is there a way to make the text rotated with OpenVG 1.1? Or should I ignore the text functionality from OpenVG 1.1 and draw the letters as individual paths or images manually?
All the draw functions use a different user->surface matrix:
vgDrawPath uses VG_MATRIX_PATH_USER_TO_SURFACE
vgDrawImage uses VG_MATRIX_IMAGE_USER_TO_SURFACE
vgDrawGlyph/vgDrawGlyphs use VG_MATRIX_GLYPH_USER_TO_SURFACE
By default, all of the matrix functions (vgTranslate, vgRotate, vgLoadMatrix, etc) operate on VG_MATRIX_PATH_USER_TO_SURFACE. To change the active matrix, call vgSeti with VG_MATRIX_MODE as the first argument:
vgSeti(VG_MATRIX_MODE, VG_MATRIX_GLYPH_USER_TO_SURFACE);
/* now vgTranslate, vgRotate, etc will operate on VG_MATRIX_GLYPH_USER_TO_SURFACE */

Resources