Fix #30430: Can only alt+scroll image buffer slot once

Issue was caused by mapping old buttons to new buttons. Render slot button in header
holds RenerResult for particular slot, but in N-panel it holds RenderResult from RenderEngine.
So what was happening is: switching render slot to empty slot makes slot button in header
contain NULL as button function's argument, but old button holds RenderResult for rendered
image, so this two buttons aren't equal and so button isn't getting activated and no scrolling
happens.
Making slot button hold RenderResult directly from RenderEngine (as it's happening with
buttons in N-panel) makes old->new buttons mapping work correct and it's possible
to alt-scroll smoothly
This commit is contained in:
Sergey Sharybin
2012-03-26 11:44:03 +00:00
parent 8439649464
commit 261e92f864

View File

@@ -874,14 +874,16 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser)
{
Scene *scene= CTX_data_scene(C);
Render *re;
RenderResult *rr;
/* render layers and passes */
if (ima && iuser) {
const float dpi_fac= UI_DPI_FAC;
rr= BKE_image_acquire_renderresult(scene, ima);
const float dpi_fac = UI_DPI_FAC;
re = RE_GetRender(scene->id.name);
rr = RE_AcquireResultRead(re);
uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type==IMA_TYPE_R_RESULT)? &ima->render_slot: NULL);
BKE_image_release_renderresult(scene, ima);
RE_ReleaseResult(re);
}
}