void gimp_paint_options_set_default_brush_hardness (GimpPaintOptions *paint_options, GimpBrush *brush) { g_return_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options)); g_return_if_fail (brush == NULL || GIMP_IS_BRUSH (brush)); if (! brush) brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options)); if (GIMP_IS_BRUSH_GENERATED (brush)) { GimpBrushGenerated *generated_brush = GIMP_BRUSH_GENERATED (brush); g_object_set (paint_options, "brush-hardness", (gdouble) gimp_brush_generated_get_hardness (generated_brush), NULL); } else { g_object_set (paint_options, "brush-hardness", DEFAULT_BRUSH_HARDNESS, NULL); } }
void gimp_paint_options_set_default_brush_spacing (GimpPaintOptions *paint_options, GimpBrush *brush) { g_return_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options)); g_return_if_fail (brush == NULL || GIMP_IS_BRUSH (brush)); if (! brush) brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options)); if (brush) { g_object_set (paint_options, "brush-spacing", (gdouble) gimp_brush_get_spacing (brush) / 100.0, NULL); } }
void context_brush_spacing_cmd_callback (GtkAction *action, gint value, gpointer data) { GimpContext *context; GimpBrush *brush; return_if_no_context (context, data); brush = gimp_context_get_brush (context); if (GIMP_IS_BRUSH (brush) && gimp_data_is_writable (GIMP_DATA (brush))) { action_select_property ((GimpActionSelectType) value, action_data_get_display (data), G_OBJECT (brush), "spacing", 1.0, 5.0, 20.0, 0.1, FALSE); } }
void gimp_paint_options_set_default_brush_size (GimpPaintOptions *paint_options, GimpBrush *brush) { g_return_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options)); g_return_if_fail (brush == NULL || GIMP_IS_BRUSH (brush)); if (! brush) brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options)); if (brush) { gint height; gint width; gimp_brush_transform_size (brush, 1.0, 0.0, 0.0, &height, &width); g_object_set (paint_options, "brush-size", (gdouble) MAX (height, width), NULL); } }