Skip to content

Commit d4d38c8

Browse files
committed
- layout
- comments - fixed debug printing - added `::utf8` utils for construct strings from (hex) ints
1 parent bf78d2d commit d4d38c8

File tree

4 files changed

+83
-81
lines changed

4 files changed

+83
-81
lines changed

core/src/main/kotlin/imgui/api/widgetsInputWithKeyboard.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ interface widgetsInputWithKeyboard {
8181
fun input(label: String, v: FloatArray, step: Float = 0f, stepFast: Float = 0f, format: String = "%.3f", flags: InputTextSingleFlags = none): Boolean =
8282
input(label, v mutablePropertyAt 0, step, stepFast, format, flags)
8383

84-
fun input(label: String, v: KMutableProperty0<Float>, step: Float = 0f, stepFast: Float = 0f, format: String = "%.3f", flags_: InputTextSingleFlags = none): Boolean {
85-
val flags = flags_ or Itf.CharsScientific
86-
return input(label, v, step.takeIf { it > 0f }, stepFast.takeIf { it > 0f }, format, flags)
87-
}
84+
fun input(label: String, v: KMutableProperty0<Float>, step: Float = 0f, stepFast: Float = 0f, format: String = "%.3f", flags: InputTextSingleFlags = none): Boolean =
85+
input(label, v, step.takeIf { it > 0f }, stepFast.takeIf { it > 0f }, format, flags / Itf.CharsScientific)
8886

8987
fun input2(label: String, v: FloatArray, format: String = "%.3f", flags: InputTextSingleFlags = none): Boolean = inputN(label, 2, null, null, format, flags, v::mutablePropertyAt)
9088

@@ -130,6 +128,7 @@ interface widgetsInputWithKeyboard {
130128
return input(label, v, step.takeIf { it > 0.0 }, stepFast.takeIf { it > 0.0 }, format, flags)
131129
}
132130

131+
/** ~InputScalar */
133132
fun <N> NumberOps<N>.input(label: String, pData: KMutableProperty0<N>, step: N? = null, stepFast: N? = null, format_: String? = null, flags_: InputTextSingleFlags = none): Boolean where N : Number, N : Comparable<N> {
134133
var data by pData
135134
val window = currentWindow
@@ -196,11 +195,11 @@ interface widgetsInputWithKeyboard {
196195

197196
}
198197

199-
inline fun <reified N> input(label: String, pData: KMutableProperty0<N>, step: N? = null, stepFast: N? = null, format_: String? = null, flags_: InputTextSingleFlags = none): Boolean where N : Number, N : Comparable<N> =
200-
ImGui.input(label, pData, step, stepFast, format_, flags_)
198+
inline fun <reified N> input(label: String, pData: KMutableProperty0<N>, step: N? = null, stepFast: N? = null, format: String? = null, flags: InputTextSingleFlags = none): Boolean where N : Number, N : Comparable<N> =
199+
ImGui.input(label, pData, step, stepFast, format, flags)
201200

202-
inline fun <reified N> ImGui.input(label: String, pData: KMutableProperty0<N>, step: N? = null, stepFast: N? = null, format_: String? = null, flags_: InputTextSingleFlags = none): Boolean where N : Number, N : Comparable<N> =
203-
numberOps<N>().input(label, pData, step, stepFast, format_, flags_)
201+
inline fun <reified N> ImGui.input(label: String, pData: KMutableProperty0<N>, step: N? = null, stepFast: N? = null, format: String? = null, flags: InputTextSingleFlags = none): Boolean where N : Number, N : Comparable<N> =
202+
numberOps<N>().input(label, pData, step, stepFast, format, flags)
204203

205204
inline fun <reified N> inputN(label: String, components: Int, step: N? = null, stepFast: N? = null, format: String? = null, flags: InputTextSingleFlags = none, properties: (Int) -> KMutableProperty0<N>): Boolean where N : Number, N : Comparable<N> =
206205
ImGui.inputN(label, components, step, stepFast, format, flags, properties)

0 commit comments

Comments
 (0)