Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_gradient_set_vector ( SPGradient *  gradient,
SPGradientVector *  vector 
)

Sets gradient vector to given value, does not update reprs

Definition at line 572 of file sp-gradient.cpp.

References sp_gradient_set_vector().

Referenced by sp_gradient_set_vector().

{
      g_return_if_fail (gradient != NULL);
      g_return_if_fail (SP_IS_GRADIENT (gradient));
      g_return_if_fail (vector != NULL);

      if (gradient->color) {
            g_free (gradient->color);
            gradient->color = NULL;
      }

      if (gradient->vector && (gradient->vector->nstops != vector->nstops)) {
            g_free (gradient->vector);
            gradient->vector = NULL;
      }
      if (!gradient->vector) {
            gradient->vector = (SPGradientVector *)g_malloc (sizeof (SPGradientVector) + (vector->nstops - 1) * sizeof (SPGradientStop));
      }
      memcpy (gradient->vector, vector, sizeof (SPGradientVector) + (vector->nstops - 1) * sizeof (SPGradientStop));

      SP_OBJECT (gradient)->requestModified(SP_OBJECT_MODIFIED_FLAG);
}


Generated by  Doxygen 1.6.0   Back to index