UI: Track translate/scale/fade transform by screen.

This translates drawing, scissor, and touch to the transform.
This commit is contained in:
Unknown W. Brackets committed 2017-03-19 15:42:13 -07:00
1 parent 92b0f00cd8
commit a36ecb7065
11 files changed
+136 -29

No files matched your search

+7 -9
View File
@@ -130,12 +130,11 @@ void ViewGroup::Draw(UIContext &dc) {
}
dc.FillRect(bg_, bounds_);
for (auto iter = views_.begin(); iter != views_.end(); ++iter) {
// TODO: If there is a transformation active, transform input coordinates accordingly.
if ((*iter)->GetVisibility() == V_VISIBLE) {
for (View *view : views_) {
if (view->GetVisibility() == V_VISIBLE) {
// Check if bounds are in current scissor rectangle.
if (dc.GetScissorBounds().Intersects((*iter)->GetBounds()))
(*iter)->Draw(dc);
if (dc.GetScissorBounds().Intersects(dc.TransformBounds(view->GetBounds())))
view->Draw(dc);
}
}
if (clip_) {
@@ -144,10 +143,9 @@ void ViewGroup::Draw(UIContext &dc) {
}
void ViewGroup::Update() {
for (auto iter = views_.begin(); iter != views_.end(); ++iter) {
// TODO: If there is a transformation active, transform input coordinates accordingly.
if ((*iter)->GetVisibility() != V_GONE)
(*iter)->Update();
for (View *view : views_) {
if (view->GetVisibility() != V_GONE)
view->Update();
}
}