主权项 |
1. A computing device, comprising:
one or more processors; a display screen; memory including instructions that, when executed by the one or more processors, cause the computing device to:
determine a first position with respect to the display screen and first dimensions for each of a plurality of user interface (UI) elements, the plurality of UI elements corresponding to a plurality of depths, each of the plurality of depths corresponding to one of a plurality of first quadtrees for storing first information relating to the plurality of UI elements and one of a plurality of second quadtrees for storing second information relating to one or more shadows cast by the plurality of UI elements;update the plurality of first quadtrees with the first position and the first dimensions of each of the plurality of UI elements;for each UI element of the plurality of UI elements that casts a shadow,
determine first properties of the shadow based at least in part upon a virtual light source for simulating shadow effects, the first position and the first dimensions of the UI element, the first position and the first dimensions of each of the plurality of UI elements that are positioned at a lower depth than the UI element, and whether the shadow intersects one of the plurality of UI elements that are positioned at the lower depth using a first quadtree of each lower depth; andupdate a second quadtree of each lower depth with the first properties of the shadow;display, on the display screen, first portions of the plurality of UI elements and first portions of one or more shadows based at least in part upon the plurality of first quadtrees and the plurality of second quadtrees;obtain an input corresponding to a modification of one or more of the first position or the first dimensions of at least one of the plurality of UI elements;determine, based at least in part upon the modification of the first position or the first dimensions of the at least one of the plurality of UI elements, a second position and second dimensions for each of the plurality of UI elements;for each UI element of the plurality of UI elements having the second position of the UI element differing from the first position of the UI element or the second dimensions of the UI element differing from the first dimensions of the UI element,
update one or more of the plurality of first quadtrees with the second position or the second dimensions of the UI element;determine second properties of the shadow cast by the UI element based at least in part upon the virtual light source, the second position and the second dimensions of the UI element, the second position and the second dimensions of each of the plurality of UI elements that are positioned at the lower depth than the UI element, and whether the shadow intersects one of the plurality of UI elements that are positioned at the lower depth using the first quadtree of each lower depth; andupdate the second quadtree of each lower depth with the second properties of the shadow; anddisplay, on the display screen, second portions of the plurality of UI elements and second portions of the one or more shadows based at least in part upon the plurality of first quadtrees and the plurality of second quadtrees. |