Skip to content

Commit

Permalink
🚧 up Apr 9, 1.60
Browse files Browse the repository at this point in the history
  • Loading branch information
elect86 committed May 4, 2018
1 parent 50e5764 commit eb64b8b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/imgui/enums.kt
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ enum class Key { Tab, LeftArrow, RightArrow, UpArrow, DownArrow, PageUp, PageDow
* Read instructions in imgui.cpp for more details. */
enum class NavInput {
// Gamepad Mapping
/** activate / open / toggle / tweak value // e.g. Circle (PS4), A (Xbox), B (Switch), Space (Keyboard) */
/** activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), B (Switch), Space (Keyboard) */
Activate,
/** cancel / close / exit // e.g. Cross (PS4), B (Xbox), A (Switch), Escape (Keyboard) */
/** cancel / close / exit // e.g. Circle (PS4), B (Xbox), A (Switch), Escape (Keyboard) */
Cancel,
/** text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) */
Input,
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/imgui/font.kt
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ class FontAtlas {

if (flags has FontAtlasFlag.NoMouseCursors) return false

assert(customRectIds[0] != -1)
val r = customRects[customRectIds[0]]
assert(r.id == DefaultTexData.id)
val pos = DefaultTexData.cursorDatas[cursor.i][0] + Vec2(r.x, r.y)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/imgui/imgui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ object ImGui :

imgui_internal {

val beta = 3
val version = "1.60.0$beta WIP"
val beta = 4
val version = "1.60.0$beta"
}

var ptrIndices = 0
Expand Down
20 changes: 0 additions & 20 deletions src/main/kotlin/imgui/imgui/internal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1369,26 +1369,6 @@ interface imgui_internal {
return pressed
}

/** [Internal]
* @param flags: ButtonFlag */
fun arrowButton(id: ID, dir: Dir, padding: Vec2, flags: Int = 0): Boolean {
val window = g.currentWindow!!
if (window.skipItems) return false

val bb = Rect(window.dc.cursorPos, window.dc.cursorPos + g.fontSize + padding * 2f)
itemSize(bb, style.framePadding.y)
if (!itemAdd(bb, id)) return false

val (pressed, hovered, held) = buttonBehavior(bb, id, flags)

val col = (if (hovered && held) Col.ButtonActive else if (hovered) Col.ButtonHovered else Col.Button).u32
renderNavHighlight(bb, id)
renderFrame(bb.min, bb.max, col, true, style.frameRounding)
renderArrow(bb.min + padding, dir, 1f)
return pressed
}


fun sliderBehavior(frameBb: Rect, id: ID, v: FloatArray, vMin: Float, vMax: Float, power: Float, decimalPrecision: Int,
flags: SliderFlags = 0) = sliderBehavior(frameBb, id, v, 0, vMin, vMax, power, decimalPrecision, flags)

Expand Down
5 changes: 2 additions & 3 deletions src/main/kotlin/imgui/imgui/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ interface imgui_main {
newFrameUpdateMovingWindow()
newFrameUpdateHoveredWindowAndCaptureFlags()

val modalWindow = frontMostModalRootWindow
g.modalWindowDarkeningRatio = when {
modalWindow == null -> 0f
g.modalWindowDarkeningRatio = when (frontMostModalRootWindow) {
null -> 0f
else -> min(g.modalWindowDarkeningRatio + io.deltaTime * 6f, 1f)
}
g.mouseCursor = MouseCursor.Arrow
Expand Down

0 comments on commit eb64b8b

Please sign in to comment.