Page MenuHome

WM: Snapping for the preview of split area
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Jan 19 2018, 4:40 AM.

Details

Summary

This is an attempt to complete the proposal T53798.

Since the preview of area split has to share internal variables of SCREEN_OT_area_split, I decided to convert the drawing function in ED_screen_draw into a callback.

But as the existing draw_callbacks are limited to areas. The solution taken was to extend the API including draw_callbacks to the struct wmWindow.

So this patch can be divided into three stages:

  • Create API for draw_callbacks in struct wmWindow;
  • Split the ED_screen_draw function into ED_screen_draw_edges, ED_screen_draw_join_shape and ED_screen_draw_split_preview and use the last two functions as callbacks called in SCREEN_OT_area_split and SCREEN_OT_area_join respectively;
  • Calculate a snap factor in ED_screen_draw_split_preview.

I will gladly accept other suggestions ;)

Diff Detail

Repository
rB Blender

Event Timeline

LGTM, nice to move away from hard coded flags into callbacks, committed rBebf01d44ee0e034da169efc0aca81f99966ebde6

This revision is now accepted and ready to land.Jan 19 2018, 7:57 AM