Skip to content

Commit 5dcf4dd

Browse files
committed
Methods to set the vertical and horizontal paddings.
1 parent 6e6d064 commit 5dcf4dd

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/ofxTextInputField.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ ofxTextInputField::ofxTextInputField() {
6969
fontRef = new ofxTextInput::BitmapFontRenderer();
7070
//isSetup = false;
7171

72-
VERTICAL_PADDING = 12;
73-
HORIZONTAL_PADDING = 10;
72+
verticalPadding = 12;
73+
horizontalPadding = 10;
7474
lastTimeCursorMoved = ofGetElapsedTimef();
7575
}
7676

@@ -141,6 +141,13 @@ void ofxTextInputField::setFont(OFX_TEXTFIELD_FONT_RENDERER& font){
141141
fontRef = new ofxTextInput::TypedFontRenderer(&font);
142142
}
143143

144+
void ofxTextInputField::setHorizontalPadding(int val){
145+
horizontalPadding = val;
146+
}
147+
148+
void ofxTextInputField::setVerticalPadding(int val){
149+
verticalPadding = val;
150+
}
144151
bool ofxTextInputField::getIsEditing(){
145152
return isEditing;
146153
}

src/ofxTextInputField.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class ofxTextInputField {
4949
void setFont(OFX_TEXTFIELD_FONT_RENDERER& font);
5050

5151
void setup();
52+
void setHorizontalPadding(int val);
53+
void setVerticalPadding(int val);
5254

5355
void enable();
5456
void disable();
@@ -100,8 +102,8 @@ class ofxTextInputField {
100102

101103
protected:
102104
float lastTimeCursorMoved;
103-
int VERTICAL_PADDING;
104-
int HORIZONTAL_PADDING;
105+
int verticalPadding;
106+
int capsVerticalOffset;
105107
ofxTextInput::FontRenderer* fontRef;
106108

107109
bool isEnabled;

0 commit comments

Comments
 (0)