app: add gimp_canvas_handle_set_size() and use it in GimpToolLine
This commit is contained in:
@ -544,6 +544,38 @@ gimp_canvas_handle_set_position (GimpCanvasItem *handle,
|
||||
gimp_canvas_item_end_change (handle);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_canvas_handle_get_size (GimpCanvasItem *handle,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_CANVAS_HANDLE (handle));
|
||||
g_return_if_fail (width != NULL);
|
||||
g_return_if_fail (height != NULL);
|
||||
|
||||
g_object_get (handle,
|
||||
"width", width,
|
||||
"height", height,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_canvas_handle_set_size (GimpCanvasItem *handle,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_CANVAS_HANDLE (handle));
|
||||
|
||||
gimp_canvas_item_begin_change (handle);
|
||||
|
||||
g_object_set (handle,
|
||||
"width", width,
|
||||
"height", height,
|
||||
NULL);
|
||||
|
||||
gimp_canvas_item_end_change (handle);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_canvas_handle_set_angles (GimpCanvasItem *handle,
|
||||
gdouble start_angle,
|
||||
|
@ -64,6 +64,13 @@ void gimp_canvas_handle_set_position (GimpCanvasItem *handle,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
|
||||
void gimp_canvas_handle_get_size (GimpCanvasItem *handle,
|
||||
gint *width,
|
||||
gint *height);
|
||||
void gimp_canvas_handle_set_size (GimpCanvasItem *handle,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
void gimp_canvas_handle_set_angles (GimpCanvasItem *handle,
|
||||
gdouble start_handle,
|
||||
gdouble slice_handle);
|
||||
|
@ -584,24 +584,12 @@ gimp_tool_line_update_hilight (GimpToolLine *line)
|
||||
hilight_point = gimp_tool_line_get_point (line);
|
||||
|
||||
if (start_visible)
|
||||
{
|
||||
gimp_canvas_item_begin_change (private->start_handle_circle);
|
||||
g_object_set (private->start_handle_circle,
|
||||
"width", start_diameter,
|
||||
"height", start_diameter,
|
||||
NULL);
|
||||
gimp_canvas_item_end_change (private->start_handle_circle);
|
||||
}
|
||||
gimp_canvas_handle_set_size (private->start_handle_circle,
|
||||
start_diameter, start_diameter);
|
||||
|
||||
if (end_visible)
|
||||
{
|
||||
gimp_canvas_item_begin_change (private->end_handle_circle);
|
||||
g_object_set (private->end_handle_circle,
|
||||
"width", end_diameter,
|
||||
"height", end_diameter,
|
||||
NULL);
|
||||
gimp_canvas_item_end_change (private->end_handle_circle);
|
||||
}
|
||||
gimp_canvas_handle_set_size (private->end_handle_circle,
|
||||
end_diameter, end_diameter);
|
||||
|
||||
gimp_canvas_item_set_highlight (private->start_handle_circle,
|
||||
hilight_point == POINT_START);
|
||||
|
Reference in New Issue
Block a user