Prevent unnecessary refresh in Clock screen.
This commit is contained in:
parent
f30573a9b0
commit
79b4f006be
2 changed files with 5 additions and 4 deletions
|
@ -91,9 +91,10 @@ void Clock::Refresh(bool fullRefresh) {
|
|||
}
|
||||
|
||||
if(fullRefresh || version.IsUpdated()) {
|
||||
char version[20];
|
||||
sprintf(version, "VERSION: %d.%d.%d", Version::Major(), Version::Minor(), Version::Patch());
|
||||
gfx.DrawString(20, 220, 0xffff, version, &smallFont, false);
|
||||
auto dummy = version.Get();
|
||||
char versionStr[20];
|
||||
sprintf(versionStr, "VERSION: %d.%d.%d", Version::Major(), Version::Minor(), Version::Patch());
|
||||
gfx.DrawString(20, 220, 0xffff, versionStr, &smallFont, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Pinetime {
|
|||
explicit DirtyValue(T v) { value = v; }
|
||||
explicit DirtyValue(T& v) { value = v; }
|
||||
bool IsUpdated() const { return isUpdated; }
|
||||
T& Get() { return value; this->isUpdated = false;}
|
||||
T& Get() { this->isUpdated = false; return value;}
|
||||
|
||||
DirtyValue& operator=(const T& other) {
|
||||
this->value = other;
|
||||
|
|
Loading…
Reference in a new issue