483 Commits (0c9ab0acdd87551133c6f73a189605a050929bec)

Author SHA1 Message Date
thedmd e22e3f300a ImDrawList: Fixed an issue when draw command merging or cancelling while crossing the VtxOffset boundary would lead to draw command being emitted with wrong VtxOffset value. (#3129, #3163, #3232) 4 years ago
ocornut 41e8837f59 Comments, adding some spacing in ImVec2() constructors. 4 years ago
ocornut 417ac68f82 Internals: AddPolyline: Add spaces for consistency, renaming. 4 years ago
Maru 6b80bd9cc3 Fix GetGlyphRangesKorean() end-range to end at 0xD7A3 (instead of 0xD79D). (#348, #3217)
https://en.wikipedia.org/wiki/Hangul_Syllables
4 years ago
Clownacy a2454f2a45
Use __NEWLIB__ instead of __SWITCH__ and __CYGWIN__ for alloca.h-detection (#3070)
Cygwin uses newlib, so it's covered by the __NEWLIB__ check.
You can see how it defines __NEWLIB__ here: https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=newlib/configure.in#l453
5 years ago
Ryan Pavlik 8cbff5ccb2 Fix various typos. (#3161)
(found by Debian's lintian on a package that uses imgui.)
(found by codespell.)
5 years ago
omar 5ac5d3674f Removed unncessary ID (first arg) of ImFontAtlas::AddCustomRectRegular() function. 5 years ago
omar e8c986b34e Version 1.77 WIP 5 years ago
omar 5503c0a12e Version 1.76
+ fixed PVS warning, update demo binaries, update readme image
5 years ago
omar cc0d4e346a Misc: Added an explicit compile-time test for non-scoped IM_ASSERT() macros to redirect users to a solution + fixed our stb wrappers.
+ Nav: Use nav layer enum, comments.
5 years ago
omar bdd31ec4db Internal: Refactor: Moved RenderColorRectWithAlphaCheckerboard() to imgui_draw.cpp, tweaked signature. 5 years ago
omar 0bbbbe0f68 Internal: Refactor: Moved RenderArrow, RenderBullet, RenderCheckMark to imgui_draw.cpp, changed RenderCheckMark to avoid using ImGui context 5 years ago
ocornut 339ffd25a9 Internals: Renamed ImBoolVector to ImBitVector, added low-level loose function to replicate the behavior include a help SetBitRange() function. 5 years ago
ocornut 0850b46c88 ImDrawList: Internals: Added IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER setting. 5 years ago
omar 0283a6e566 ImFont: Demo, Store Used4kPagesMap[] map in ImFont to facilitate iteration on all codepoints with a large value of IM_UNICODE_CODEPOINT_MAX. (#2815)
Demo uses IsGlyphRangeUnused()
5 years ago
Sam Hocevar c8ea0a017d Unicode: UTF32 support improvements (#2541, #2538, #2815)
- Make ImWchar32 unsigned.
 - Fix Win32 version of ImFileOpen by including windows.h sooner.
 - Make ImGuiIO::AddInputCharacterUTF16() more robust by disallowing illegal
surrogate pairs.
 - Allow pushing higher plane codepoints through ImGuiIO::AddInputCharacter().
 - Minor cleaning up in the high-plane Unicode support.
 - Fix Clang -Wunreachable-code warning
5 years ago
Cloud Wu 6d59653e82 Unicode: full Unicode Support (6 squashed commits) (#2541, #2538)
fix build for WideCharToMultiByte
[3181ff1e] Full Unicode Support
[6c9e73ac] Fix ImTextCountUtf8BytesFromChar and ImTextCharToUtf8, these APIs assume the input is an unicode code point, not UTF-16
[ba85665b] Add AddInputCharacterUTF16 for windows backend to handle WM_CHAR
[fafdcaf0] Use Windows API to convert UTF-16 for ImFileOpen
[dc7d5925] Use windows API to convert UTF-16 for clipboard
5 years ago
Omar 09329ea4e6 Fix Clang 9.0 zealous warnings 5 years ago
omar d284a6cffc InputText: Fixed password fields displaying ASCII spaces as blanks. Fixed non-ASCII space occasionally creating unnecessary empty polygons. (#2149, #515) 5 years ago
omar ccaec1a270 Version 1.76 WIP 5 years ago
omar d16c87a5b1 Internals: Minor renaming 5 years ago
omar 58b3e02b95 Version 1.75
Comments
5 years ago
omar d37d25470a Added IMGUI_DISABLE compile-time definition to make all headers and sources empty. 5 years ago
Rokas Kupstys 9cff4d6e5e Columns: ImDrawList::Channels* functions now work inside columns.
Use a private splitter in columns, paving way for removal of obsolete ImDrawList::Channels* functions.
5 years ago
omar 5363af7f47 AddCircle, AddCircleFilled: Add auto-calculation of circle segment counts (amends)
Tweak default max error value, Changelog, comments, path-fast for 12 segments circles, made LUT store ImU8
5 years ago
Ben Carter 051ce0765e AddCircle, AddCircleFilled: Add auto-calculation of circle segment counts 5 years ago
omar d581939387 Removed trailing spaces. 5 years ago
omar f70204f2f4 Minor bits, placeholder aimed at facilitating merging of Tables branch into Docking 5 years ago
omar a610f1da52 Bezier Tweaks, fixed parameter order of 3831d50 5 years ago
Rokas Kupstys 3831d50ab9 Add ImBezierClosestPoint() function which returns a point on bezier curve which is closed to a specified point. 5 years ago
Ben Carter 0e74103659 ImDrawList: Add AddNgon(), AddNgonFilled() API. 5 years ago
Ben Carter 697f15e339 Added PrimUnreserve() API. Obsoleted calling ImDrawList::PrimReserve() with a negative count. 5 years ago
omar 8342e5b91a Amend previous commits (added ImGuiMouseCursor_NotAllowed enum + new cursors in GLFW 3.4)
Amend b5cad20d79, 945a509773
+ unrelated minor typos
5 years ago
omar abaf0256b8 Version 1.75 WIP
Added message to font file loading assert.
5 years ago
omar bdce833636 Version 1.74 5 years ago
omar 51e2e9b239 ImVector: Added shrink() helper. ImFont::RenderText minor optimisation for debug build. Misc: Metrics shows tab names because we now have them. 5 years ago
omar 51a02b319c Added IM_UNICODE_CODEPOINT_MAX. Changed specs of ImFontAtlas::AddCustomRectRegular() (breaking change). 5 years ago
stfx 6bf5aed325 Declaration and assignment can be joined, Member function may be 'const'. (#2875) 5 years ago
Rokas Kupstys c863c1f6a1 Clean up number rounding. Now it is more obvious what code is doing. (#2862)
Add IM_ROUND() macro
Replace IM_FLOOR(n + 0.5f) and ImFloor(n + 0.5f) with IM_ROUND(n)
5 years ago
Rokas Kupstys 714fe29d1a Replace manual flooring with IM_FLOOR() macro. (#2850)
Macro is used to ensure that flooring operation is always inlined even in debug builds. __forceinline does not force inlining in /Od builds with MSVC.

(cherry picked from commit bc165df6fd7969605bbc07b8a6d3d28f9109e8f3)
5 years ago
omar c262276988 Version 1.74 WIP 5 years ago
omar d5efe16157 Version 1.73 5 years ago
omar 52deb415e0 Internal: Refactored internal RenderMouseCursor so colors can be specified. (#2614) 5 years ago
omar 098591fe4c ImDrawListSplitter: fixed an issue merging channels if the last submitted draw command used a different texture. (#2506) 5 years ago
omar 3b014d0c31 Merge branch 'features/ellipsis_rendering'
# Conflicts:
#	imgui.cpp
5 years ago
omar 7d5a17e5e4 Remove trailing spaces (grep for ' \r?$' in visual studio) 5 years ago
omar 57623c15dd Font: Narrow ellipsis: various minor stylistic tweaks (#2775) 5 years ago
Rokas Kupstys 45405f0dc9 Font: implement a way to draw narrow ellipsis without relying on hardcoded 1 pixel dots. (#2775)
This changeset implements several pieces of the puzzle that add up to a narrow ellipsis rendering.

## EllipsisCodePoint

`ImFontConfig` and `ImFont` received `ImWchar EllipsisCodePoint = -1;` field. User may configure `ImFontConfig::EllipsisCodePoint` a unicode codepoint that will be used for rendering narrow ellipsis. Not setting this field will automatically detect a suitable character or fall back to rendering 3 dots with minimal spacing between them. Autodetection prefers codepoint 0x2026 (narrow ellipsis) and falls back to 0x0085 (NEXT LINE) when missing. Wikipedia indicates that codepoint 0x0085 was used as ellipsis in some older windows fonts. So does default Dear ImGui font. When user is merging fonts - first configured and present ellipsis codepoint will be used, ellipsis characters from subsequently merged fonts will be ignored.

## Narrow ellipsis

Rendering a narrow ellipsis is surprisingly not straightforward task. There are cases when ellipsis is bigger than the last visible character therefore `RenderTextEllipsis()` has to hide last two characters. In a subset of those cases ellipsis is as big as last visible character + space before it. `RenderTextEllipsis()` tries to work around this case by taking free space between glyph edges into account. Code responsible for this functionality is within `if (text_end_ellipsis != text_end_full) { ... }`.

## Fallback (manually rendered dots)

There are cases when font does not have ellipsis character defined. In this case RenderTextEllipsis() falls back to rendering ellipsis as 3 dots, but with reduced spacing between them. 1 pixel space is used in all cases. This results in a somewhat wider ellipsis, but avoids issues where spaces between dots are uneven (visible in larger/monospace fonts) or squish dots way too much (visible in default font where dot is essentially a pixel). This fallback method obsoleted `RenderPixelEllipsis()` and this function was removed. Note that fallback ellipsis will always be somewhat wider than it could be, however it will fit in visually into every font used unlike what `RenderPixelEllipsis()` produced.
5 years ago
omar c4ff1b3578 ImDrawList: clarified the name of many parameters so reading the code is a little easier. (#2740) 5 years ago
omar f624455d7b Version 1.73 WIP 5 years ago
omar 6a0d0dab5a Version 1.72b (patch for nav) 5 years ago
omar 9183e7c426 Version 1.73 WIP 5 years ago
omar ecb9b1e2eb Version 1.72 5 years ago
omar 51853292cc ImDrawList: Using ImDrawCornerFlags instead of int in various apis.
Demo: Using ImGuiColorEditrFlags instead of int.
5 years ago
omar d52c6316c8 Renamed ImFontAtlas::CustomRect to ImFontAtlasCustomRect. Keep redirection typedef (will obsolete). 5 years ago
omar 82711251b6 Internals: ImGuiListClipper using absolute coordinate (instead of relative one). Minor no-op tweaks + ImDrawListSplitter assert 5 years ago
omar 1dd322c6fb Style: Attenuated default opacity of ImGuiCol_Separator in Classic and Light styles. 5 years ago
omar dd41df3e98 Word-wrapping: Fixed overzealous word-wrapping when glyph edge lands exactly on the limit. Because of this, auto-fitting exactly unwrapped text would make it wrap. (fixes initial 1.15 commit, 78645a7d). 5 years ago
omar e9b92d1cef Disable -Wpragmas warning in GCC to avoid relying on version checks, as unusual/forks/mods don't appear to always have same warning<>version. (#2618)
+ Fix version number in imgui.h
5 years ago
omar b82e99c032 ImDrawList: Fixed CloneOutput() helper crashing. Also removed unnecessary risk from ImDrawList::Clear(), draw lists are being clear before use each frame anyway. (#1860) 5 years ago
omar 2645a2516f ImDrawList::ChannelsSplit(), ImDrawListSlitter: Fixed an issue with merging draw commands between channels 0 and 1. (#2624) Introduced by cef88f6aae. 5 years ago
omar 5286ecb8a7 Version 1.72 WIP 5 years ago
omar 2da1c66d15 Version 1.71 + comments 5 years ago
omar 4597632662 Readme, comments, dear imgui prefixes 5 years ago
omar a9b5c834b6 ImDrawListSplitter: Don't merge draw commands when crossing a VtxOffset boundary + Renamed fields ImDrawChannels to consistently suggest those are internal structures. 5 years ago
omar d8435c7710 ImDrawListSplitter: Fix idx offset when merging (cef88f6) (#2591) 5 years ago
omar afa3978ff6 Internals: Added drawlist and color arg to RenderArrow(), RenderBullet(). Reordered args for RenderPixelEllipsis. 5 years ago
omar cef88f6aae ImDrawListSplitter: Support merging consecutive draw commands straddling two channels. Support zero-init. 5 years ago
omar f1f4b42d91 ImDrawListSplitter: extracted out of ImDrawList. Down the line we may obsolete the ImDrawList functions and encourage users to store the splitter aside, in the meanwhile ImDrawList holds a splitter.
(This will allow columns/table to recurse.)
5 years ago
omar 8abf1313aa ImDrawList: Fix broken channel splitting (another issue when the first channel is empty) (#2591) + fixed warnings with newer VS 5 years ago
Sebastian Krzyszkowiak bff7202ff2 Include <alloca.h> also when __SWITCH__ is defined (#2595)
Fixes compilation with devkitPro for Nintendo Switch
5 years ago
omar 42c98c5eea ImDrawList: Fix broken channel splitting (broken by d1e8b69) (#2591) 5 years ago
omar d1e8b698d0 ImDrawList: Added ImDrawCmd::VtxOffset value to support large meshes (64k+ vertices) using 16-bits indices. To enable the feature, the renderer back-end needs to set 'io.BackendFlags |= ImGuiBackendFlags_HasVtxOffset' and honor the ImDrawCmd::VtxOffset field. Otherwise the value will always be zero. This has the advantage of preserving smaller index buffers and allowing to execute on hardware that do not support 32-bits indices.
ImDrawList: Added ImDrawCmd::IdxOffset value, equivalent to summing element count for each draw command. This is provided for convenience and consistency with VtxOffset. (#2591)
5 years ago
omar 40b9e5e0b4 ImDrawList: Store initial flags for the frame in ImDrawListSharedData, reducing code duplication in setting up the flags. 5 years ago
omar 34b881eb12 ImFontGlyphRangesBuilder: Fixed unnecessarily over-sized buffer, which incidentally was also not fully cleared. Fixed edge case overflow when adding character 0xFFFF. (#2568) 5 years ago
omar f242cd4d8a Fixed GCC mem-access warnings (#2565)
+ using "if defined" more consistently for Clang.
5 years ago
Lionel Landwerlin 679cf7434e Fix undefined behavior (#2561) 5 years ago
omar 42fc563fed Version 1.71 WIP + fixed minor typo 5 years ago
omar d1d5075b66 Version 1.70 6 years ago
omar 0f2852806c Amend 48a09a7 with changelog, breaking changes, tweak demo code for spacing. (#2518) 6 years ago
Richard Mitton 4c0f34fd5d Improved algorithm for mitre joints on thick lines 6 years ago
omar c8fd4afd75 Misc: Added IM_MALLOC/IM_FREE macros mimicking IM_NEW/IM_DELETE so user doesn't need to revert to using the ImGui::MemAlloc()/MemFree() calls directly. 6 years ago
omar 8dab7ac021 InputText: Made Shift+Tab consistently do nothing regardless of whether the back-end emits both char and keys or just keys. (#2467, #1336) 6 years ago
Nicolas Noble d9568c717d Silencing -Wstack-protector (#2459) 6 years ago
omar 221bf93a55 Comments, todo list, remove trailing spaces. 6 years ago
omar cf2c52282d Version 1.70 WIP 6 years ago
omar 55c02099c5 Version 1.69, comments, typos 6 years ago
omar a92c587c75 Added GetGlyphRangesVietnamese() helper. (#2403) 6 years ago
Bruce Mitchener b5d57a6615 Fix typos. (#2413) 6 years ago
Elias Daler c3ea1748dc Fix -Wconversion warning (#2379)
The warning was caused by implicit conversion from pointer type which
NULL has to non-pointer type, e.g. if ImTextureID is long int
6 years ago
omar 677e64e71e Internal: InputText: Comments. Renamed internal member. Renamed ImGuiStb->ImStb. 6 years ago
omar 257f5d204e Version 1.69 WIP 6 years ago
omar 3c15dffc94 Version 1.68 6 years ago
omar f5bf6e38d2 Font: Fixed assert when specifying duplicate/overlapping ranges within a same font. (#2353, #2233) 6 years ago
omar 93d1179805 Examples: Extracted gamepad code into ImGui_ImplGlfw_UpdateGamepads(). Renamed matching Win32 function for consistency.
Added more link to nothing's oversample document. Spacing bits.
6 years ago
omar a79785c0b9 ImDrawData: Added FramebufferScale field (currently a copy of the value from io.DisplayFramebufferScale).
This is to allow render functions being written without pulling any data from ImGuiIO, allowing incoming multi-viewport feature to behave on Retina display and with multiple displays. If you are not using a custom binding, please update your render function code ahead of time, and use draw_data->FramebufferScale instead of io.DisplayFramebufferScale. (#2306, #1676)
Examples: Metal, OpenGL2, OpenGL3: Fixed offsetting of clipping rectangle with ImDrawData::DisplayPos != (0,0) when the display frame-buffer scale scale is not (1,1). While this doesn't make a difference when using master branch, this is effectively fixing support for multi-viewport with Mac Retina Displays on those examples. (#2306) Also using ImDrawData::FramebufferScale instead of io.DisplayFramebufferScale.
Examples: Clarified the use the ImDrawData::DisplayPos to offset clipping rectangles.
6 years ago
omar 4b41d3b280 ImFont: Rearranged members toward an optimal CalcTextSize() loop. Removed comments from destructor. Made constructor more explicit. 6 years ago
omar d38f4dc143 Tabs: Non-docking tab bars are storing names to allow tab list button + whole style scaling. Added ImGuiTabBarFlags_TabListPopupButton flag to show a popup button on manual tab bars. Locking FramePadding for the scope of a tab-bar to avoid sheering/clipping of tab item. Made scaling of tab ellipsis less awkward. (#261, #351) 6 years ago
omar 8e44aacc8e Fonts: Fixed crash if FontGlobalScale is zero. Correctly debug naming default font if not 13 px. Demo: Moved PopupRounding along with other rounding values. Metrics: Displaying indexes with idx to be correct / less misleading. 6 years ago
omar 4e8e177cac Persistently fixing some PVS-Studio static analyzer false positive warnings. 6 years ago