Fixed a small copy & paste error which pushes the wrong texture
into an empty draw list. In normal cases this never occurs but is
still a big if used independent of libraries use cases.
`nk_tree__push` was not supposed to be seen as private but more like
the more extended way of handling duplicate tree elements. But I used
double underscore which is the general indicator for private. I renamed
it know to nk_tree_push_id, to hopefully make it clearer.
This commit fixes a bug that occurs if you move the cursor inside
text and then back to the end of the text and insert a character.
Caused was the bug by an incorrect check if the cursor is at the
end of the string.
Previously if you use `nk_edit_string` and use flag
`NK_EDIT_CLIPBOARD`, callbacks were not passed. I only tested it with
`nk_edit_buffer` and set the callbacks directly. This wrong behavior
is now fixed and should work copy & paste should behave correctly.
I previously used a conditional style so I don't have to compare
floats directly with eachother because of warning. This caused some
bugs and I now reverted back all conditions back to normal.
In addition I oversampled the default font to make it look better.
Thanks to @codemeow I fixed some bugs and warnings found with
cppcheck. NOTE: it seems like all static analyzer fail to
detect the assert macro or hate combining assert ans if checks.
Some minor issues: an unused variable, fixed a comparison of int against
float, and a pragma warning (pop) that didn't have a matching pragma
warning (push). Potentially more serious was a possible buffer overrun,
where a pointer was being tested against a null terminator, instead of
the char it points to.
There were a few casts from void * missing causing problems when
compiling as C++, also the assert function from <assert.h> was being
used instead of NK_ASSERT(...) in one place.
Fixed window movement for windows without header and some small
wrong calculation inside the panel layout code. In addition I
added another example implementing a simple calculator.
This is the first release version of nuklear (previously: zahnrad).
As for those who no the old version will notice: a lot has changed.
Most obvious should be the two biggest changes. First the name change
because I got critique that the name is hard to comprehend and
remember (understandable for non-germans) and the second is the
transistion from four files (zahnrad.h, zahnrad.c, stb_truetype
and stb_rect_pack) to one single header library file nuklear.h.
I am not 100% convinced that using a single header library is the
right choice here but so far I haven't encountered any problems.
Noticable should be as well that nuklear now directly embeds three
stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like
in previous versions the first two are optional and the library
can be compiled without. stb_textedit on the other hand powers
the text edit implementation for single as well as multiline
text manipulation. The text edit implementation is still relative
new and untested so you can expect some bugs I have not found yet.
In the demo department a lot changed as well. All platform demos
now don't compile one big demo but instead contain a simple
demo and small abstraction layer over the platform. Main benefit is
better understandablity improved ease of use. The old demo
is now split up and transfered into the example folder while each part
is self contained and compileable. (All examples use glfw I don't now
if this is the best platform but it is at least the simplest.
I also removed the apple demo because I don't have an apple system
and cannot make sure the new version runs with the old version.
Finally a lot of small bugs have been fixed as well as bugs found by
clang analyzer and coverity.