meltygui-imgui 2.0.2__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/PKG-INFO +5 -5
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/README.md +12 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui.cpp +12 -11
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui_draw.cpp +21 -5
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui_tables.cpp +4 -4
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui.egg-info/PKG-INFO +5 -5
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui.egg-info/SOURCES.txt +1 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/setup.py +1 -1
- meltygui_imgui-2.0.3/tests/test_text_pixel_alignment.py +81 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/LICENSE +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/LICENSES/imgui-MIT.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/LICENSES/imstb_rectpack.h.license.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/LICENSES/imstb_textedit.h.license.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/LICENSES/imstb_truetype.h.license.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/MANIFEST.in +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/MELTYGUI.md +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/UPSTREAM.json +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/ansifeed-cpp/AnsiTextColored.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/ansifeed-cpp/AnsiTextColored.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/config-cpp/py_imconfig.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/config-cpp/py_imconfig.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_allegro5.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_allegro5.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_android.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_android.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx10.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx10.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx11.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx11.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx12.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx12.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx9.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_dx9.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_glfw.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_glfw.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_glut.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_glut.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_marmalade.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_marmalade.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_metal.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_opengl2.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_opengl2.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_opengl3.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_opengl3.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_osx.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_sdl.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_sdl.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_vulkan.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_vulkan.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_wgpu.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_wgpu.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_win32.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/backends/imgui_impl_win32.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imconfig.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui_demo.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui_internal.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imgui_widgets.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imstb_rectpack.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imstb_textedit.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/imstb_truetype.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/cpp/imgui_stdlib.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/cpp/imgui_stdlib.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/fonts/binary_to_compressed_c.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/freetype/imgui_freetype.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/freetype/imgui_freetype.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/single_file/imgui_single_file.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/__init__.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/_compat.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/ansifeed.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/cimgui.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/common.pyx +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/core.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/core.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/core.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/core.pyi +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/core.pyx +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/enums.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/enums_internal.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/extra.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/__init__.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/base.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/cocos2d.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/glfw.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/glumpy.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/opengl.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/pygame.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/pyglet.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/integrations/sdl2.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/internal.cpp +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/internal.h +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/internal.pxd +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/internal.pyi +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/internal.pyx +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui/py.typed +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui.egg-info/dependency_links.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui.egg-info/requires.txt +2 -2
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/meltygui_imgui.egg-info/top_level.txt +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/pyproject.toml +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/setup.cfg +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_begin_end_context_managers.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_context_mem_safety.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_crazy_callbacks.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_graphics_mem_safety.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_gui_style_initialization.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tests/test_stub_signatures.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/build.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/build_in_container.sh +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/build_windows.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/generate_stubs.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/smoke.py +0 -0
- {meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/tools/verify.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meltygui-imgui
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Cython-based Python bindings for dear meltygui_imgui
|
|
5
5
|
Home-page: https://github.com/Attentio-AI/meltygui-imgui
|
|
6
6
|
Author: Michał Jaworski
|
|
@@ -45,14 +45,14 @@ Requires-Dist: PyOpenGL; extra == "pyglet"
|
|
|
45
45
|
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "pyglet"
|
|
46
46
|
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "pyglet"
|
|
47
47
|
Provides-Extra: full
|
|
48
|
-
Requires-Dist:
|
|
48
|
+
Requires-Dist: PyOpenGL; extra == "full"
|
|
49
49
|
Requires-Dist: cocos2d; extra == "full"
|
|
50
|
-
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "full"
|
|
51
|
-
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "full"
|
|
52
50
|
Requires-Dist: Cython<0.30,>=0.24; extra == "full"
|
|
51
|
+
Requires-Dist: glfw; extra == "full"
|
|
53
52
|
Requires-Dist: pygame; extra == "full"
|
|
53
|
+
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "full"
|
|
54
|
+
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "full"
|
|
54
55
|
Requires-Dist: PySDL2; extra == "full"
|
|
55
|
-
Requires-Dist: PyOpenGL; extra == "full"
|
|
56
56
|
Dynamic: author
|
|
57
57
|
Dynamic: author-email
|
|
58
58
|
Dynamic: classifier
|
|
@@ -29,6 +29,18 @@ missing wheel an error rather than a compilation.
|
|
|
29
29
|
|
|
30
30
|
The bundled Dear ImGui and font-helper license notices are included in the artifacts.
|
|
31
31
|
|
|
32
|
+
## Fractional coordinates (2.0.3)
|
|
33
|
+
|
|
34
|
+
The maintained binding retains fractional mouse, window, scroll and cursor
|
|
35
|
+
positions. Text origins align to physical framebuffer pixels only when drawing,
|
|
36
|
+
restoring crisp 1x text and allowing pixel-sized steps on Retina displays without
|
|
37
|
+
rounding scroll offsets or interaction coordinates. Applications and font sizes
|
|
38
|
+
still use logical coordinates. Rebuild the native extension on
|
|
39
|
+
each target platform when upgrading; copying Python modules is insufficient.
|
|
40
|
+
Hosts that interpolate a dense font atlas can define
|
|
41
|
+
`IMGUI_ENABLE_FRACTIONAL_TEXT`; Hub's iOS Retina runtime does this to retain
|
|
42
|
+
continuous touch scrolling.
|
|
43
|
+
|
|
32
44
|
## IntelliJ IDEA / PyCharm
|
|
33
45
|
|
|
34
46
|
The package ships `.pyi` signatures for its native extensions, including the
|
|
@@ -772,6 +772,7 @@ CODE
|
|
|
772
772
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
|
773
773
|
#endif
|
|
774
774
|
#include "imgui_internal.h"
|
|
775
|
+
// Melty subpixel coordinates: keep logical positions fractional through rasterization.
|
|
775
776
|
|
|
776
777
|
// System includes
|
|
777
778
|
#include <ctype.h> // toupper
|
|
@@ -3623,7 +3624,7 @@ static void ImGui::UpdateMouseInputs()
|
|
|
3623
3624
|
|
|
3624
3625
|
// Round mouse position to avoid spreading non-rounded position (e.g. UpdateManualResize doesn't support them well)
|
|
3625
3626
|
if (IsMousePosValid(&g.IO.MousePos))
|
|
3626
|
-
g.
|
|
3627
|
+
g.LastValidMousePos = g.IO.MousePos;
|
|
3627
3628
|
|
|
3628
3629
|
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX components) we cancel out movement in MouseDelta
|
|
3629
3630
|
if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MousePosPrev))
|
|
@@ -5982,7 +5983,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
5982
5983
|
if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
|
|
5983
5984
|
if (viewport_rect.GetWidth() > 0.0f && viewport_rect.GetHeight() > 0.0f)
|
|
5984
5985
|
ClampWindowRect(window, visibility_rect);
|
|
5985
|
-
|
|
5986
|
+
// Keep the fractional position of children inside a scrolling parent.
|
|
5986
5987
|
|
|
5987
5988
|
// Lock window rounding for the frame (so that altering them doesn't cause inconsistencies)
|
|
5988
5989
|
// Large values tend to lead to variety of artifacts and are not recommended.
|
|
@@ -6162,8 +6163,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
6162
6163
|
const bool allow_scrollbar_y = !(flags & ImGuiWindowFlags_NoScrollbar);
|
|
6163
6164
|
const float work_rect_size_x = (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : ImMax(allow_scrollbar_x ? window->ContentSize.x : 0.0f, window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
|
|
6164
6165
|
const float work_rect_size_y = (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : ImMax(allow_scrollbar_y ? window->ContentSize.y : 0.0f, window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
|
|
6165
|
-
window->WorkRect.Min.x =
|
|
6166
|
-
window->WorkRect.Min.y =
|
|
6166
|
+
window->WorkRect.Min.x = window->InnerRect.Min.x - window->Scroll.x + ImMax(window->WindowPadding.x, window->WindowBorderSize);
|
|
6167
|
+
window->WorkRect.Min.y = window->InnerRect.Min.y - window->Scroll.y + ImMax(window->WindowPadding.y, window->WindowBorderSize);
|
|
6167
6168
|
window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x;
|
|
6168
6169
|
window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y;
|
|
6169
6170
|
window->ParentWorkRect = window->WorkRect;
|
|
@@ -6671,7 +6672,7 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
|
|
|
6671
6672
|
|
|
6672
6673
|
// Set
|
|
6673
6674
|
const ImVec2 old_pos = window->Pos;
|
|
6674
|
-
window->Pos =
|
|
6675
|
+
window->Pos = pos;
|
|
6675
6676
|
ImVec2 offset = window->Pos - old_pos;
|
|
6676
6677
|
window->DC.CursorPos += offset; // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor
|
|
6677
6678
|
window->DC.CursorMaxPos += offset; // And more importantly we need to offset CursorMaxPos/CursorStartPos this so ContentSize calculation doesn't get affected.
|
|
@@ -7307,8 +7308,8 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
|
|
|
7307
7308
|
//if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
|
|
7308
7309
|
window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
|
|
7309
7310
|
window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y;
|
|
7310
|
-
window->DC.CursorPos.x =
|
|
7311
|
-
window->DC.CursorPos.y =
|
|
7311
|
+
window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x; // Next line
|
|
7312
|
+
window->DC.CursorPos.y = window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y; // Next line
|
|
7312
7313
|
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
|
|
7313
7314
|
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y);
|
|
7314
7315
|
//if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]
|
|
@@ -7779,8 +7780,8 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window)
|
|
|
7779
7780
|
scroll_target_y = CalcScrollEdgeSnap(scroll_target_y, snap_y_min, snap_y_max, window->ScrollTargetEdgeSnapDist.y, center_y_ratio);
|
|
7780
7781
|
scroll.y = scroll_target_y - center_y_ratio * (window->SizeFull.y - window->ScrollbarSizes.y - decoration_up_height);
|
|
7781
7782
|
}
|
|
7782
|
-
scroll.x =
|
|
7783
|
-
scroll.y =
|
|
7783
|
+
scroll.x = ImMax(scroll.x, 0.0f);
|
|
7784
|
+
scroll.y = ImMax(scroll.y, 0.0f);
|
|
7784
7785
|
if (!window->Collapsed && !window->SkipItems)
|
|
7785
7786
|
{
|
|
7786
7787
|
scroll.x = ImMin(scroll.x, window->ScrollMax.x);
|
|
@@ -7882,7 +7883,7 @@ void ImGui::SetScrollY(float scroll_y)
|
|
|
7882
7883
|
void ImGui::SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio)
|
|
7883
7884
|
{
|
|
7884
7885
|
IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f);
|
|
7885
|
-
window->ScrollTarget.x =
|
|
7886
|
+
window->ScrollTarget.x = local_x + window->Scroll.x; // Convert local position to scroll offset
|
|
7886
7887
|
window->ScrollTargetCenterRatio.x = center_x_ratio;
|
|
7887
7888
|
window->ScrollTargetEdgeSnapDist.x = 0.0f;
|
|
7888
7889
|
}
|
|
@@ -7891,7 +7892,7 @@ void ImGui::SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y
|
|
|
7891
7892
|
{
|
|
7892
7893
|
IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f);
|
|
7893
7894
|
local_y -= window->TitleBarHeight() + window->MenuBarHeight(); // FIXME: Would be nice to have a more standardized access to our scrollable/client rect
|
|
7894
|
-
window->ScrollTarget.y =
|
|
7895
|
+
window->ScrollTarget.y = local_y + window->Scroll.y; // Convert local position to scroll offset
|
|
7895
7896
|
window->ScrollTargetCenterRatio.y = center_y_ratio;
|
|
7896
7897
|
window->ScrollTargetEdgeSnapDist.y = 0.0f;
|
|
7897
7898
|
}
|
|
@@ -34,6 +34,7 @@ Index of this file:
|
|
|
34
34
|
#endif
|
|
35
35
|
|
|
36
36
|
#include "imgui_internal.h"
|
|
37
|
+
// Melty subpixel coordinates: keep layout/input fractional; align text at rasterization.
|
|
37
38
|
#ifdef IMGUI_ENABLE_FREETYPE
|
|
38
39
|
#include "misc/freetype/imgui_freetype.h"
|
|
39
40
|
#endif
|
|
@@ -3469,6 +3470,23 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
|
|
3469
3470
|
return text_size;
|
|
3470
3471
|
}
|
|
3471
3472
|
|
|
3473
|
+
// Melty text pixel alignment: quantize only the glyph origin, in framebuffer
|
|
3474
|
+
// pixels. Layout, scroll offsets and hit testing keep their fractional values.
|
|
3475
|
+
static ImVec2 ImFontSnapToPixelGrid(const ImVec2& pos)
|
|
3476
|
+
{
|
|
3477
|
+
#ifdef IMGUI_ENABLE_FRACTIONAL_TEXT
|
|
3478
|
+
// The iOS runtime opts into continuous motion with its dense font atlas.
|
|
3479
|
+
return pos;
|
|
3480
|
+
#else
|
|
3481
|
+
const ImVec2 scale = GImGui ? GImGui->IO.DisplayFramebufferScale : ImVec2(1.0f, 1.0f);
|
|
3482
|
+
const ImVec2 origin = GImGui ? ImGui::GetMainViewport()->Pos : ImVec2(0.0f, 0.0f);
|
|
3483
|
+
const float sx = scale.x > 0.0f ? scale.x : 1.0f;
|
|
3484
|
+
const float sy = scale.y > 0.0f ? scale.y : 1.0f;
|
|
3485
|
+
return ImVec2(origin.x + ImFloorStd((pos.x - origin.x) * sx) / sx,
|
|
3486
|
+
origin.y + ImFloorStd((pos.y - origin.y) * sy) / sy);
|
|
3487
|
+
#endif
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3472
3490
|
void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
|
|
3473
3491
|
{
|
|
3474
3492
|
const ImFontGlyph* glyph = FindGlyph(c);
|
|
@@ -3477,8 +3495,7 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
|
|
3477
3495
|
if (glyph->Colored)
|
|
3478
3496
|
col |= ~IM_COL32_A_MASK;
|
|
3479
3497
|
float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
|
|
3480
|
-
pos
|
|
3481
|
-
pos.y = IM_FLOOR(pos.y);
|
|
3498
|
+
pos = ImFontSnapToPixelGrid(pos);
|
|
3482
3499
|
draw_list->PrimReserve(6, 4);
|
|
3483
3500
|
draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
|
|
3484
3501
|
}
|
|
@@ -3488,9 +3505,8 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
|
|
3488
3505
|
if (!text_end)
|
|
3489
3506
|
text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
|
|
3490
3507
|
|
|
3491
|
-
// Align to
|
|
3492
|
-
pos
|
|
3493
|
-
pos.y = IM_FLOOR(pos.y);
|
|
3508
|
+
// Align glyphs to physical pixels without rounding the logical cursor.
|
|
3509
|
+
pos = ImFontSnapToPixelGrid(pos);
|
|
3494
3510
|
float x = pos.x;
|
|
3495
3511
|
float y = pos.y;
|
|
3496
3512
|
if (y > clip_rect.w)
|
|
@@ -3795,7 +3795,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
|
|
|
3795
3795
|
float width = offset_1 - offset_0;
|
|
3796
3796
|
PushItemWidth(width * 0.65f);
|
|
3797
3797
|
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
|
3798
|
-
window->DC.CursorPos.x =
|
|
3798
|
+
window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x;
|
|
3799
3799
|
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
|
|
3800
3800
|
}
|
|
3801
3801
|
|
|
@@ -3810,7 +3810,7 @@ void ImGui::NextColumn()
|
|
|
3810
3810
|
|
|
3811
3811
|
if (columns->Count == 1)
|
|
3812
3812
|
{
|
|
3813
|
-
window->DC.CursorPos.x =
|
|
3813
|
+
window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x;
|
|
3814
3814
|
IM_ASSERT(columns->Current == 0);
|
|
3815
3815
|
return;
|
|
3816
3816
|
}
|
|
@@ -3841,7 +3841,7 @@ void ImGui::NextColumn()
|
|
|
3841
3841
|
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
|
3842
3842
|
columns->LineMinY = columns->LineMaxY;
|
|
3843
3843
|
}
|
|
3844
|
-
window->DC.CursorPos.x =
|
|
3844
|
+
window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x;
|
|
3845
3845
|
window->DC.CursorPos.y = columns->LineMinY;
|
|
3846
3846
|
window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
|
|
3847
3847
|
window->DC.CurrLineTextBaseOffset = 0.0f;
|
|
@@ -3927,7 +3927,7 @@ void ImGui::EndColumns()
|
|
|
3927
3927
|
window->ParentWorkRect = columns->HostBackupParentWorkRect;
|
|
3928
3928
|
window->DC.CurrentColumns = NULL;
|
|
3929
3929
|
window->DC.ColumnsOffset.x = 0.0f;
|
|
3930
|
-
window->DC.CursorPos.x =
|
|
3930
|
+
window->DC.CursorPos.x = window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x;
|
|
3931
3931
|
}
|
|
3932
3932
|
|
|
3933
3933
|
void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meltygui-imgui
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Cython-based Python bindings for dear meltygui_imgui
|
|
5
5
|
Home-page: https://github.com/Attentio-AI/meltygui-imgui
|
|
6
6
|
Author: Michał Jaworski
|
|
@@ -45,14 +45,14 @@ Requires-Dist: PyOpenGL; extra == "pyglet"
|
|
|
45
45
|
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "pyglet"
|
|
46
46
|
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "pyglet"
|
|
47
47
|
Provides-Extra: full
|
|
48
|
-
Requires-Dist:
|
|
48
|
+
Requires-Dist: PyOpenGL; extra == "full"
|
|
49
49
|
Requires-Dist: cocos2d; extra == "full"
|
|
50
|
-
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "full"
|
|
51
|
-
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "full"
|
|
52
50
|
Requires-Dist: Cython<0.30,>=0.24; extra == "full"
|
|
51
|
+
Requires-Dist: glfw; extra == "full"
|
|
53
52
|
Requires-Dist: pygame; extra == "full"
|
|
53
|
+
Requires-Dist: pyglet>=1.5.6; sys_platform == "darwin" and extra == "full"
|
|
54
|
+
Requires-Dist: pyglet; sys_platform != "darwin" and extra == "full"
|
|
54
55
|
Requires-Dist: PySDL2; extra == "full"
|
|
55
|
-
Requires-Dist: PyOpenGL; extra == "full"
|
|
56
56
|
Dynamic: author
|
|
57
57
|
Dynamic: author-email
|
|
58
58
|
Dynamic: classifier
|
|
@@ -102,6 +102,7 @@ tests/test_crazy_callbacks.py
|
|
|
102
102
|
tests/test_graphics_mem_safety.py
|
|
103
103
|
tests/test_gui_style_initialization.py
|
|
104
104
|
tests/test_stub_signatures.py
|
|
105
|
+
tests/test_text_pixel_alignment.py
|
|
105
106
|
tools/build.py
|
|
106
107
|
tools/build_in_container.sh
|
|
107
108
|
tools/build_windows.py
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Raster alignment must not quantize ImGui's layout or input state."""
|
|
2
|
+
import ctypes
|
|
3
|
+
import math
|
|
4
|
+
import struct
|
|
5
|
+
import unittest
|
|
6
|
+
|
|
7
|
+
import meltygui_imgui as imgui
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def vertices(draw):
|
|
11
|
+
data = ctypes.string_at(draw.vtx_buffer_data, draw.vtx_buffer_size * imgui.VERTEX_SIZE)
|
|
12
|
+
return [struct.unpack_from('ff', data, i * imgui.VERTEX_SIZE + imgui.VERTEX_BUFFER_POS_OFFSET)
|
|
13
|
+
for i in range(draw.vtx_buffer_size)]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class TextPixelAlignmentTests(unittest.TestCase):
|
|
17
|
+
def setUp(self):
|
|
18
|
+
self.context = imgui.create_context()
|
|
19
|
+
self.io = imgui.get_io()
|
|
20
|
+
self.io.ini_file_name = None
|
|
21
|
+
self.io.display_size = (400, 400)
|
|
22
|
+
self.io.delta_time = 1 / 60
|
|
23
|
+
self.io.fonts.get_tex_data_as_rgba32()
|
|
24
|
+
self.io.fonts.texture_id = 1
|
|
25
|
+
|
|
26
|
+
def tearDown(self):
|
|
27
|
+
imgui.destroy_context(self.context)
|
|
28
|
+
|
|
29
|
+
def draw(self, position, text=True):
|
|
30
|
+
imgui.new_frame()
|
|
31
|
+
draw = imgui.get_foreground_draw_list()
|
|
32
|
+
x, y = position
|
|
33
|
+
if text:
|
|
34
|
+
draw.add_text(x, y, 0xffffffff, 'Crisp text\nSecond line')
|
|
35
|
+
else:
|
|
36
|
+
draw.add_rect_filled(x, y, x + 40, y + 20, 0xffffffff)
|
|
37
|
+
result = vertices(draw)
|
|
38
|
+
imgui.render()
|
|
39
|
+
return result
|
|
40
|
+
|
|
41
|
+
def test_fractional_text_matches_pixel_aligned_text_at_each_density(self):
|
|
42
|
+
for scale in ((1, 1), (1.25, 1.5), (2, 2), (3, 3)):
|
|
43
|
+
self.io.display_fb_scale = scale
|
|
44
|
+
for fraction in (.125, .25, .5, .875):
|
|
45
|
+
with self.subTest(scale=scale, fraction=fraction):
|
|
46
|
+
pos = (50 + fraction, 61 + fraction)
|
|
47
|
+
aligned = tuple(math.floor(v * s) / s for v, s in zip(pos, scale))
|
|
48
|
+
actual = self.draw(pos)
|
|
49
|
+
self.assertTrue(actual)
|
|
50
|
+
self.assertEqual(actual, self.draw(aligned))
|
|
51
|
+
|
|
52
|
+
def test_shapes_and_pointer_coordinates_remain_fractional(self):
|
|
53
|
+
self.io.mouse_pos = (51.25, 62.125)
|
|
54
|
+
before = self.draw((50, 60), text=False)
|
|
55
|
+
after = self.draw((50.125, 60.125), text=False)
|
|
56
|
+
for first, second in zip(before, after):
|
|
57
|
+
self.assertEqual(tuple(b - a for a, b in zip(first, second)), (.125, .125))
|
|
58
|
+
self.assertEqual(tuple(self.io.mouse_pos), (51.25, 62.125))
|
|
59
|
+
|
|
60
|
+
def test_child_scroll_and_cursor_keep_subpixel_precision(self):
|
|
61
|
+
def frame():
|
|
62
|
+
imgui.new_frame()
|
|
63
|
+
imgui.set_next_window_position(0, 0)
|
|
64
|
+
imgui.set_next_window_size(400, 400)
|
|
65
|
+
with imgui.begin('Host', flags=imgui.WINDOW_NO_DECORATION):
|
|
66
|
+
with imgui.begin_child('Child', 250, 250, flags=imgui.WINDOW_HORIZONTAL_SCROLLING_BAR):
|
|
67
|
+
result = (imgui.get_scroll_x(), imgui.get_scroll_y(), tuple(imgui.get_cursor_screen_pos()))
|
|
68
|
+
imgui.dummy(1000, 1000)
|
|
69
|
+
imgui.set_scroll_x(50.125)
|
|
70
|
+
imgui.set_scroll_y(60.375)
|
|
71
|
+
imgui.render()
|
|
72
|
+
return result
|
|
73
|
+
for _ in range(4):
|
|
74
|
+
x, y, cursor = frame()
|
|
75
|
+
self.assertEqual((x, y), (50.125, 60.375))
|
|
76
|
+
self.assertAlmostEqual(cursor[0] % 1, .875)
|
|
77
|
+
self.assertAlmostEqual(cursor[1] % 1, .625)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == '__main__':
|
|
81
|
+
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/fonts/binary_to_compressed_c.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{meltygui_imgui-2.0.2 → meltygui_imgui-2.0.3}/imgui-cpp/misc/single_file/imgui_single_file.h
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|