mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] Avoid useless redrawing in ExpressionView::setLayout
This commit is contained in:
@@ -18,13 +18,11 @@ ExpressionView::ExpressionView(float horizontalAlignment, float verticalAlignmen
|
||||
}
|
||||
|
||||
bool ExpressionView::setLayout(Layout layoutR) {
|
||||
/* TODO: this would avoid some useless redrawing. However, when we call
|
||||
* setLayout after raising an Exception that led to erase all
|
||||
* Poincare::TreePool, accessing m_layout will result in an ACCESS ERROR.
|
||||
* How do we avoid that? */
|
||||
/*if (m_layout.isIdenticalTo(layoutR)) {
|
||||
if (!m_layout.wasErasedByException() && m_layout.isIdenticalTo(layoutR)) {
|
||||
/* Check m_layout.wasErasedByException(), otherwise accessing m_layout would
|
||||
* result in an ACCESS ERROR. */
|
||||
return false;
|
||||
}*/
|
||||
}
|
||||
m_layout = layoutR;
|
||||
markRectAsDirty(bounds());
|
||||
return true;
|
||||
|
||||
@@ -62,6 +62,9 @@ public:
|
||||
|
||||
uint16_t identifier() const { return m_identifier; }
|
||||
TreeNode * node() const;
|
||||
bool wasErasedByException() const {
|
||||
return hasNode(m_identifier) && node() == nullptr;
|
||||
}
|
||||
int nodeRetainCount() const { return node()->retainCount(); }
|
||||
size_t size() const;
|
||||
void * addressInPool() const { return reinterpret_cast<void *>(node()); }
|
||||
|
||||
Reference in New Issue
Block a user