Commit Graph

7 Commits

Author SHA1 Message Date
patrick96
e904b408d1 fix(builder): ignored offsets
The builder::offset function returned immediately if a valid extent was
passed instead of when an invalid one was passed.
2022-03-14 22:58:01 +01:00
infokiller
fb6e874235 feat(label): Add minlen with alignment (#1546)
* Add label minlen and alignment.

Fix build

* Update src/drawtypes/label.cpp

Co-Authored-By: infokiller <infokiller@users.noreply.github.com>

* Use existing alignment type.

* Remove redundant max_len handling in label::get.

* Fix shadowing.

* Add label alignment tests.

* Handle minlen/maxlen and alignment in same function.

Also add a test for a test case brought up in the PR discussion.

* Format files with clang-format

* Move builder::get_label_text tests into label tests

builder::get_label_text doesn't really do anything anymore

* builder: remove get_label_text

* label: Clean up label::get()

* Fix comment style.

* Set default label alignment to left.

* Update src/drawtypes/label.cpp

Co-Authored-By: Patrick Ziegler <p.ziegler96@gmail.com>

* Update include/drawtypes/label.hpp

Co-Authored-By: Patrick Ziegler <p.ziegler96@gmail.com>
2019-12-01 01:28:41 +01:00
patrick96
6d3b323f16 refactor(gtest): TestCase->TestSuite
googletest deprecated the TEST_CASE terminology in
3a460a26b7a91abf87af7f31b93d29f930e25c82
2019-02-07 10:20:08 +01:00
patrick96
9e595d388e fix(gtest): INSTANTIATE_TEST_CASE_P with zero variadic arguments
Due to google/googletest#1419 [1], we had to add a comma after the last
argument of INSTANTIATE_TEST_CASE_P.

This was "fixed" in a backwards incompatible way in the googletest
project in 7c4164bf404d899b6d4c74beb1070da5647f55a2

[1]: https://github.com/google/googletest/issues/1419
2019-02-07 10:20:08 +01:00
patrick96
0346a965a7 refactor(builder): No exception when maxlen < 3
The check of the maxlen and ellipsis condition was also moved to the
label creation, this way get_label_text doesn't need to care about the
restrictions placed on maxlen and ellipsis
2018-07-22 14:02:15 -07:00
patrick96
7dc42f543f fix(builder): Respect label-ellipsis option
This slightly changes the existing behavior of maxlen. Before with a
maxlen of 4 'abcde' used to yield 'abcd...' now it yields 'a...'
2018-07-22 14:02:15 -07:00
patrick96
4b83468eb9 refactor(builder): Add failing test for ellipsis
Adds failing tests for the bug described in #1194
2018-07-22 14:02:15 -07:00