929
929
/** Returns the attributes block and the character index within that block
930
930
which represents the iterator \a position. */
931
static TextTagAttributes*
932
932
text_tag_attributes_at_position(SPItem *item, Inkscape::Text::Layout::iterator const &position, unsigned *char_index)
934
934
if (item == NULL || char_index == NULL || !SP_IS_TEXT(item))
976
sp_te_adjust_dx (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
979
TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index);
980
if (attributes) attributes->addToDx(char_index, delta);
982
attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index);
983
if (attributes) attributes->addToDx(char_index, -delta);
987
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
991
sp_te_adjust_dy (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
994
TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index);
995
if (attributes) attributes->addToDy(char_index, delta);
997
attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index);
998
if (attributes) attributes->addToDy(char_index, -delta);
1002
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
976
1006
sp_te_adjust_rotation_screen(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, gdouble pixels)
978
1008
// divide increment by zoom
1045
sp_te_set_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop */*desktop*/, gdouble degrees)
1047
unsigned char_index;
1048
TextTagAttributes *attributes = text_tag_attributes_at_position(text, std::min(start, end), &char_index);
1049
if (attributes == NULL) return;
1052
for (Inkscape::Text::Layout::iterator it = std::min(start, end) ; it != std::max(start, end) ; it.nextCharacter()) {
1053
attributes = text_tag_attributes_at_position(text, it, &char_index);
1054
if (attributes) attributes->setRotate(char_index, degrees);
1057
attributes->setRotate(char_index, degrees);
1060
text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
1015
1064
sp_te_adjust_tspan_letterspacing_screen(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, gdouble by)
1017
1066
g_return_if_fail (text != NULL);
1843
1892
text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
1895
bool is_part_of_text_subtree (SPObject *obj)
1897
return (SP_IS_TSPAN(obj)
1899
|| SP_IS_FLOWTEXT(obj)
1900
|| SP_IS_FLOWTSPAN(obj)
1901
|| SP_IS_FLOWDIV(obj)
1902
|| SP_IS_FLOWPARA(obj)
1903
|| SP_IS_FLOWLINE(obj)
1904
|| SP_IS_FLOWREGIONBREAK(obj));
1907
bool is_top_level_text_object (SPObject *obj)
1909
return (SP_IS_TEXT(obj)
1910
|| SP_IS_FLOWTEXT(obj));
1913
bool has_visible_text (SPObject *obj)
1915
if (SP_IS_STRING(obj) && !SP_STRING(obj)->string.empty())
1916
return true; // maybe we should also check that it's not all whitespace?
1918
for (SPObject const *child = obj->firstChild() ; child ; child = SP_OBJECT_NEXT(child)) {
1919
if (has_visible_text((SPObject *) child))
1847
1927
Local Variables: