forked from bartvdbraak/blender
bugfix [#20480] crash/lock-up for certain aspect ratios
This commit is contained in:
parent
2061f91741
commit
bc9b873f60
@ -47,6 +47,7 @@ extern "C" {
|
|||||||
* @return True if @a rect is empty.
|
* @return True if @a rect is empty.
|
||||||
*/
|
*/
|
||||||
int BLI_rcti_is_empty(struct rcti *rect);
|
int BLI_rcti_is_empty(struct rcti *rect);
|
||||||
|
int BLI_rctf_is_empty(struct rctf *rect);
|
||||||
void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float ymax);
|
void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float ymax);
|
||||||
void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax);
|
void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax);
|
||||||
void BLI_translate_rctf(struct rctf *rect, float x, float y);
|
void BLI_translate_rctf(struct rctf *rect, float x, float y);
|
||||||
|
@ -48,6 +48,12 @@ int BLI_rcti_is_empty(rcti * rect)
|
|||||||
(rect->ymax<=rect->ymin));
|
(rect->ymax<=rect->ymin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int BLI_rctf_is_empty(rctf * rect)
|
||||||
|
{
|
||||||
|
return ((rect->xmax<=rect->xmin) ||
|
||||||
|
(rect->ymax<=rect->ymin));
|
||||||
|
}
|
||||||
|
|
||||||
int BLI_in_rcti(rcti * rect, int x, int y)
|
int BLI_in_rcti(rcti * rect, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)
|
|||||||
|
|
||||||
node->prvr.xmin= node->locx + NODE_DYS;
|
node->prvr.xmin= node->locx + NODE_DYS;
|
||||||
node->prvr.xmax= node->locx + node->width- NODE_DYS;
|
node->prvr.xmax= node->locx + node->width- NODE_DYS;
|
||||||
|
|
||||||
/* preview rect? */
|
/* preview rect? */
|
||||||
if(node->flag & NODE_PREVIEW) {
|
if(node->flag & NODE_PREVIEW) {
|
||||||
/* only recalculate size when there's a preview actually, otherwise we use stored result */
|
/* only recalculate size when there's a preview actually, otherwise we use stored result */
|
||||||
@ -820,7 +820,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
|||||||
/* preview */
|
/* preview */
|
||||||
if(node->flag & NODE_PREVIEW) {
|
if(node->flag & NODE_PREVIEW) {
|
||||||
BLI_lock_thread(LOCK_PREVIEW);
|
BLI_lock_thread(LOCK_PREVIEW);
|
||||||
if(node->preview && node->preview->rect)
|
if(node->preview && node->preview->rect && !BLI_rctf_is_empty(&node->prvr))
|
||||||
node_draw_preview(node->preview, &node->prvr);
|
node_draw_preview(node->preview, &node->prvr);
|
||||||
BLI_unlock_thread(LOCK_PREVIEW);
|
BLI_unlock_thread(LOCK_PREVIEW);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user