Skip to content
Permalink
Browse files

Allow querying current scissor without UI layout

Widgets may query the current scissor region to reduce render calls,
e.g. by not rendering children or other elements that are not visible.
During a regular layout and render cycle, the UI framework pushes a
scissor region of the entire screen, so this works fine. When doing
ad-hoc rendering (while we transition to full use of the UI framework),
this is not the case, which caused crashes.
  • Loading branch information...
aidanholm committed Sep 16, 2019
1 parent e6ffb7a commit 3da5d4e088fbd54146bd7e5ed90dbafaddf0d5f0
Showing with 3 additions and 1 deletion.
  1. +3 −1 crawl-ref/source/ui.cc
@@ -1658,7 +1658,9 @@ void pop_scissor()

i4 get_scissor()
{
return scissor_stack.top();
if (scissor_stack.size() > 0)
return scissor_stack.top();
return {0, 0, INT_MAX, INT_MAX};
}

#ifndef USE_TILE_LOCAL

0 comments on commit 3da5d4e

Please sign in to comment.
You can’t perform that action at this time.