Commit Graph

431 Commits

Author SHA1 Message Date
ocornut 417ac68f82 Internals: AddPolyline: Add spaces for consistency, renaming. 2020-05-18 12:07:53 +02:00
Maru 6b80bd9cc3 Fix GetGlyphRangesKorean() end-range to end at 0xD7A3 (instead of 0xD79D). (#348, #3217)
https://en.wikipedia.org/wiki/Hangul_Syllables
2020-05-11 18:01:42 +02:00
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
2020-04-28 16:15:00 +02:00
Ryan Pavlik 8cbff5ccb2 Fix various typos. (#3161)
(found by Debian's lintian on a package that uses imgui.)
(found by codespell.)
2020-04-28 16:10:15 +02:00
omar 5ac5d3674f Removed unncessary ID (first arg) of ImFontAtlas::AddCustomRectRegular() function. 2020-04-23 19:27:04 +02:00
omar e8c986b34e Version 1.77 WIP 2020-04-14 14:55:50 +02:00
omar 5503c0a12e Version 1.76
+ fixed PVS warning, update demo binaries, update readme image
2020-04-12 20:18:47 +02:00
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.
2020-04-03 12:41:33 +02:00
omar bdd31ec4db Internal: Refactor: Moved RenderColorRectWithAlphaCheckerboard() to imgui_draw.cpp, tweaked signature. 2020-03-18 22:48:23 +01:00
omar 0bbbbe0f68 Internal: Refactor: Moved RenderArrow, RenderBullet, RenderCheckMark to imgui_draw.cpp, changed RenderCheckMark to avoid using ImGui context 2020-03-18 22:48:22 +01:00
ocornut 339ffd25a9 Internals: Renamed ImBoolVector to ImBitVector, added low-level loose function to replicate the behavior include a help SetBitRange() function. 2020-03-13 18:50:02 +01:00
ocornut 0850b46c88 ImDrawList: Internals: Added IM_DRAWLIST_ARCFAST_TESSELLATION_MULTIPLIER setting. 2020-03-03 19:26:27 +01:00
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()
2020-03-03 18:53:29 +01:00
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
2020-03-03 18:53:29 +01:00
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
2020-03-03 18:53:29 +01:00
Omar 09329ea4e6 Fix Clang 9.0 zealous warnings 2020-02-17 15:29:59 +01:00
omar d284a6cffc InputText: Fixed password fields displaying ASCII spaces as blanks. Fixed non-ASCII space occasionally creating unnecessary empty polygons. (#2149, #515) 2020-02-11 19:28:11 +01:00
omar ccaec1a270 Version 1.76 WIP 2020-02-11 16:56:56 +01:00
omar d16c87a5b1 Internals: Minor renaming 2020-02-10 16:46:51 +01:00
omar 58b3e02b95 Version 1.75
Comments
2020-02-10 14:02:41 +01:00
omar d37d25470a Added IMGUI_DISABLE compile-time definition to make all headers and sources empty. 2020-02-09 17:08:33 +01:00
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.
2020-01-31 12:02:56 +01:00
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
2020-01-23 14:55:05 +01:00
Ben Carter 051ce0765e AddCircle, AddCircleFilled: Add auto-calculation of circle segment counts 2020-01-23 14:52:48 +01:00
omar d581939387 Removed trailing spaces. 2020-01-06 15:24:16 +01:00
omar f70204f2f4 Minor bits, placeholder aimed at facilitating merging of Tables branch into Docking 2019-12-19 16:53:44 +01:00
omar a610f1da52 Bezier Tweaks, fixed parameter order of 3831d50 2019-12-17 16:43:05 +01:00
Rokas Kupstys 3831d50ab9 Add ImBezierClosestPoint() function which returns a point on bezier curve which is closed to a specified point. 2019-12-17 16:22:02 +01:00
Ben Carter 0e74103659 ImDrawList: Add AddNgon(), AddNgonFilled() API. 2019-12-09 11:23:06 +01:00
Ben Carter 697f15e339 Added PrimUnreserve() API. Obsoleted calling ImDrawList::PrimReserve() with a negative count. 2019-12-08 16:06:32 +01:00
omar 8342e5b91a Amend previous commits (added ImGuiMouseCursor_NotAllowed enum + new cursors in GLFW 3.4)
Amend b5cad20d79, 945a509773
+ unrelated minor typos
2019-12-05 15:45:30 +01:00
omar abaf0256b8 Version 1.75 WIP
Added message to font file loading assert.
2019-11-28 20:58:16 +01:00
omar bdce833636 Version 1.74 2019-11-25 18:38:53 +01:00
omar 51e2e9b239 ImVector: Added shrink() helper. ImFont::RenderText minor optimisation for debug build. Misc: Metrics shows tab names because we now have them. 2019-11-22 14:06:51 +01:00
omar 51a02b319c Added IM_UNICODE_CODEPOINT_MAX. Changed specs of ImFontAtlas::AddCustomRectRegular() (breaking change). 2019-11-21 14:13:17 +01:00
stfx 6bf5aed325 Declaration and assignment can be joined, Member function may be 'const'. (#2875) 2019-10-29 17:11:49 +01:00
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)
2019-10-29 17:05:25 +01:00
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 bc165df6fd)
2019-10-18 16:18:38 +02:00
omar c262276988 Version 1.74 WIP 2019-09-30 14:27:56 +02:00
omar d5efe16157 Version 1.73 2019-09-24 17:02:26 +02:00
omar 52deb415e0 Internal: Refactored internal RenderMouseCursor so colors can be specified. (#2614) 2019-09-23 14:53:49 +02:00
omar 098591fe4c ImDrawListSplitter: fixed an issue merging channels if the last submitted draw command used a different texture. (#2506) 2019-09-17 20:27:15 +02:00
omar 3b014d0c31 Merge branch 'features/ellipsis_rendering'
# Conflicts:
#	imgui.cpp
2019-09-17 12:07:30 +02:00
omar 7d5a17e5e4 Remove trailing spaces (grep for ' \r?$' in visual studio) 2019-09-17 11:33:18 +02:00
omar 57623c15dd Font: Narrow ellipsis: various minor stylistic tweaks (#2775) 2019-09-17 11:13:34 +02:00
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.
2019-09-17 11:13:07 +02:00
omar c4ff1b3578 ImDrawList: clarified the name of many parameters so reading the code is a little easier. (#2740) 2019-08-22 17:43:57 +02:00
omar f624455d7b Version 1.73 WIP 2019-08-01 10:57:13 -07:00
omar 6a0d0dab5a Version 1.72b (patch for nav) 2019-07-31 14:31:06 -07:00
omar 9183e7c426 Version 1.73 WIP 2019-07-29 15:54:32 -07:00