User Details
- User Since
- Oct 14 2015, 8:42 AM (383 w, 1 h)
May 6 2016
Paste updated. I've tested border-zoom in and out in image view which looks good. Still haven't deal with the key confict mentioned in the description.
https://developer.blender.org/P355
May 5 2016
I've taken a look into zoom out from 'view2d' which uses 'RNA_int_get(op->ptr, "gesture_mode")' to get the gesture. In view2d it returns 'GESTURE_MODAL_IN' with LMB border select and 'GESTURE_MODAL_OUT' with MMB, but in my 'image_view_zoom_border_exec', it returns 'GESTURE_MODAL_SELECT' with LMB border select and 'GESTURE_MODAL_DESELECT' with MMB border select.
Another question is, '&ar->v2d' holds a 'cur' value which's said to be the current viewable region in the wiki, but it seems to be very different in image space and view2d, so what's the cur's unit and how is the region's coordinate defined?
May 4 2016
Paste updated. I've tested border-zoom in image view which looks good. I haven't deal with the key confict mentioned in the description.
Sorry for the inconvenience. Here's the diff.
https://developer.blender.org/P355
I added two functions in 'image_ops.c', also the keymap and header. It could triger the border select cross, but whichever key(LMB, RMB, ESC) I pressed, there was no effect.
Here's the two function I added.
static int image_view_zoom_border_exec(bContext *C, wmOperator *op)
{
SpaceImage *sima;
ARegion *ar;Apr 29 2016
The question here is I can't find any border zoom implementation in other spaces except in 'view2d' and 'view3d', so I wonder that how these spaces have this function while some spaces like 'text space' doesn't. Maybe I need to get more familiar with the code base in case that I miss something.
By the way, if anyone can get this done, I'm happy to learn.
Apr 28 2016
@Campbell Barton (campbellbarton). I'm trying to figure out the implementation by checking the event handle process. What I have in mind is that the image editor should use the "view2d" to handle "zoom to border" event. I try to look into how other editors(e.g. sequencer) implement this feature. I think that the "ED" function and "main region" functions handle this. I know the keymap can be added by adding "ED_KEYMAP_VIEW2D" to the flag, which can handle the shortcut input. But the zoom function needs other implementation which I lost track of. Could you give me some advice on this, like which files or functions I can refer to?
Apr 27 2016
Hello. I'm trying to fix the conflict by simply comment out the "pinned" shortcut as below. But "zoom to border" still dosen't work. What am I missing here?
