diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-05-20 04:23:31 +0000 |
|---|---|---|
| committer | John Smith <removethis.john.q.public@bigmail.com> | 2012-05-20 04:23:31 +0000 |
| commit | 3f67967cd8a4852de65eefb4d1d142f807642be2 (patch) | |
| tree | 9cdca878b43ef19ec052b33a273f2215ae33caf0 /src/widgets/gradient-vector.cpp | |
| parent | C++ification of SPWidget. (diff) | |
| download | inkscape-3f67967cd8a4852de65eefb4d1d142f807642be2.tar.gz inkscape-3f67967cd8a4852de65eefb4d1d142f807642be2.zip | |
Fix for 973195 : Limit width of color profile labels
(bzr r11388)
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/gradient-vector.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 64b2d3a5e..e396c9768 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -270,15 +270,15 @@ Glib::ustring gr_prepare_label (SPObject *obj) } /* - * Ellipse text if longer than maxlen, "30% start text + ... + ~70% end text" + * Ellipse text if longer than maxlen, "50% start text + ... + ~50% end text" * Text should be > length 8 or just return the original text */ Glib::ustring gr_ellipsize_text(Glib::ustring const &src, size_t maxlen) { if (src.length() > maxlen && maxlen > 8) { - size_t p1 = (size_t) maxlen / 3; - size_t p2 = (size_t) src.length() - (maxlen-p1-3); // 3 ellipses - return src.substr(0, p1) + "..." + src.substr(p2); + size_t p1 = (size_t) maxlen / 2; + size_t p2 = (size_t) src.length() - (maxlen - p1 - 1); + return src.substr(0, p1) + "…" + src.substr(p2); } return src; } |
