Commit 783e0401 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: make letter spacing work when there is no selection

parent 9af58d8c
......@@ -1089,6 +1089,7 @@ gimp_text_tool_change_spacing (GimpTextTool *text_tool,
gtk_text_buffer_get_iter_at_mark (buffer, &start,
gtk_text_buffer_get_insert (buffer));
end = start;
gtk_text_iter_forward_char (&end);
}
gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
......
......@@ -468,35 +468,15 @@ gimp_text_buffer_change_spacing (GimpTextBuffer *buffer,
g_return_if_fail (start != NULL);
g_return_if_fail (end != NULL);
if (gtk_text_iter_equal (start, end))
return;
iter = *start;
span_start = *start;
span_spacing = get_spacing_at_iter (buffer, &iter, &span_tag);
gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (buffer));
if (gtk_text_iter_equal (start, end))
{
span_end = span_start;
if (span_spacing != 0)
{
gtk_text_buffer_remove_tag (GTK_TEXT_BUFFER (buffer), span_tag,
&span_start, &span_end);
}
if (span_spacing + count != 0)
{
span_tag = get_spacing_tag (buffer, span_spacing + count);
gtk_text_buffer_apply_tag (GTK_TEXT_BUFFER (buffer), span_tag,
&span_start, &span_end);
}
gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (buffer));
return;
}
do
{
gint iter_spacing;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment