Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: F746_SD_GraphicEqualizer_ren0620
Fork of F746_GUI by
Diff: Label.cpp
- Revision:
- 9:c379410bda15
- Parent:
- 4:cbf7ed9092a3
diff -r 8c5107c91d02 -r c379410bda15 Label.cpp
--- a/Label.cpp Thu Apr 21 01:12:59 2016 +0000
+++ b/Label.cpp Sun Apr 24 11:49:42 2016 +0000
@@ -1,7 +1,7 @@
//-----------------------------------------------------------
// Label class
//
-// 2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/04/24, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#include "Label.hpp"
@@ -35,4 +35,16 @@
lcd_.SetTextColor(textColor);
DrawString(PosX(X_), Y_, str);
}
+
+ uint16_t Label::PosX(uint16_t x)
+ {
+ if (MODE_ == LEFT) return x;
+ else
+ {
+ if (MODE_ == CENTER)
+ return x - length_*FONTS_->Width/2;
+ else
+ return x - length_*FONTS_->Width;
+ }
+ }
}
