Trackpad pans for UV/Image and MovieClip editors were inverse compared to all other editors.
This commit is contained in:
@@ -84,6 +84,8 @@
|
||||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_colormanagement.h"
|
||||
|
||||
#include "GPU_extensions.h"
|
||||
|
||||
#include "BIF_gl.h"
|
||||
#include "BIF_glutil.h"
|
||||
|
||||
@@ -885,6 +887,8 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
|
||||
ID *id = sp->id;
|
||||
short idtype = GS(id->name);
|
||||
|
||||
printf("icon start job %s\n", id->name);
|
||||
|
||||
if (idtype == ID_IM) {
|
||||
Image *ima = (Image *)id;
|
||||
ImBuf *ibuf = NULL;
|
||||
@@ -1007,8 +1011,27 @@ static void icon_preview_endjob(void *customdata)
|
||||
{
|
||||
IconPreview *ip = customdata;
|
||||
|
||||
if (ip->id && GS(ip->id->name) == ID_BR)
|
||||
WM_main_add_notifier(NC_BRUSH | NA_EDITED, ip->id);
|
||||
if (ip->id) {
|
||||
printf("icon end job %s\n", ip->id->name);
|
||||
|
||||
if (GS(ip->id->name) == ID_BR)
|
||||
WM_main_add_notifier(NC_BRUSH | NA_EDITED, ip->id);
|
||||
|
||||
if (GS(ip->id->name) == ID_MA) {
|
||||
Material *ma = (Material *)ip->id;
|
||||
PreviewImage *prv_img = ma->preview;
|
||||
int i;
|
||||
|
||||
/* signal to gpu texture */
|
||||
for (i = 0; i < NUM_ICON_SIZES; ++i) {
|
||||
if (prv_img->gputexture[i]) {
|
||||
GPU_texture_free(prv_img->gputexture[i]);
|
||||
prv_img->gputexture[i] = NULL;
|
||||
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ip->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void icon_preview_free(void *customdata)
|
||||
@@ -1044,7 +1067,7 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
|
||||
|
||||
/* setup job */
|
||||
WM_jobs_customdata_set(wm_job, ip, icon_preview_free);
|
||||
WM_jobs_timer(wm_job, 0.25, NC_MATERIAL, NC_MATERIAL);
|
||||
WM_jobs_timer(wm_job, 0.1, NC_MATERIAL, NC_MATERIAL);
|
||||
WM_jobs_callbacks(wm_job, icon_preview_startjob_all_sizes, NULL, NULL, icon_preview_endjob);
|
||||
|
||||
WM_jobs_start(CTX_wm_manager(C), wm_job);
|
||||
|
||||
@@ -382,8 +382,8 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
float offset[2];
|
||||
|
||||
offset[0] = (event->x - event->prevx) / sc->zoom;
|
||||
offset[1] = (event->y - event->prevy) / sc->zoom;
|
||||
offset[0] = (event->prevx - event->x) / sc->zoom;
|
||||
offset[1] = (event->prevy - event->y) / sc->zoom;
|
||||
|
||||
RNA_float_set_array(op->ptr, "offset", offset);
|
||||
|
||||
|
||||
@@ -299,8 +299,8 @@ static int image_view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
SpaceImage *sima = CTX_wm_space_image(C);
|
||||
float offset[2];
|
||||
|
||||
offset[0] = (event->x - event->prevx) / sima->zoom;
|
||||
offset[1] = (event->y - event->prevy) / sima->zoom;
|
||||
offset[0] = (event->prevx - event->x) / sima->zoom;
|
||||
offset[1] = (event->prevy - event->y) / sima->zoom;
|
||||
RNA_float_set_array(op->ptr, "offset", offset);
|
||||
|
||||
image_view_pan_exec(C, op);
|
||||
|
||||
Reference in New Issue
Block a user