summaryrefslogtreecommitdiffstats
path: root/src/gradient-drag.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2015-03-01 08:57:53 +0000
committertavmjong-free <tavmjong@free.fr>2015-03-01 08:57:53 +0000
commitb5be22f5bd07ff14b7eade763fb9b6f755d1cf5c (patch)
treecc69f348083dfde94488df361adaf4cb5b4d2908 /src/gradient-drag.cpp
parentif viewbox does not exist in file, set the document-units to be px. (Bug 1239... (diff)
downloadinkscape-b5be22f5bd07ff14b7eade763fb9b6f755d1cf5c.tar.gz
inkscape-b5be22f5bd07ff14b7eade763fb9b6f755d1cf5c.zip
Rename <meshGradient> to <mesh>, <meshRow> to <meshrow>, <meshPatch> to <meshpatch>.
Remove experimental smoothing types. Add new smoothing 'type' attribute with bicubic smoothing option. Per SVG WG decission at Sydney 2015 face-to-face meeting. (bzr r13956)
Diffstat (limited to 'src/gradient-drag.cpp')
-rw-r--r--src/gradient-drag.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 154b7339b..cb2bd737f 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -43,7 +43,7 @@
#include "knot.h"
#include "sp-linear-gradient.h"
#include "sp-radial-gradient.h"
-#include "sp-mesh-gradient.h"
+#include "sp-mesh.h"
#include "sp-mesh-row.h"
#include "sp-mesh-patch.h"
#include "gradient-chemistry.h"
@@ -414,7 +414,7 @@ SPStop *GrDrag::addStopNearPoint(SPItem *item, Geom::Point mouse_p, double toler
//r1_knot = false;
}
}
- } else if (SP_IS_MESHGRADIENT(gradient)) {
+ } else if (SP_IS_MESH(gradient)) {
// add_stop_near_point()
// Find out which curve pointer is over and use that curve to determine
@@ -422,7 +422,7 @@ SPStop *GrDrag::addStopNearPoint(SPItem *item, Geom::Point mouse_p, double toler
// This is silly as we already should know which line we are over...
// but that information is not saved (sp_gradient_context_is_over_line).
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ SPMesh *mg = SP_MESH(gradient);
Geom::Affine transform = Geom::Affine(mg->gradientTransform)*(Geom::Affine)item->i2dt_affine();
guint rows = mg->array.patch_rows();
@@ -550,7 +550,7 @@ SPStop *GrDrag::addStopNearPoint(SPItem *item, Geom::Point mouse_p, double toler
} else {
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ SPMesh *mg = SP_MESH(gradient);
if( divide_row > -1 ) {
mg->array.split_row( divide_row, divide_coord );
@@ -559,7 +559,7 @@ SPStop *GrDrag::addStopNearPoint(SPItem *item, Geom::Point mouse_p, double toler
}
// Update repr
- sp_meshgradient_repr_write( mg );
+ sp_mesh_repr_write( mg );
mg->array.built = false;
mg->ensureArray();
// How do we do this?
@@ -1349,7 +1349,7 @@ GrDragger::updateHandles ( Geom::Point pc_old, MeshNodeOperation op )
// Must be a mesh gradient
SPGradient *gradient = getGradient(draggable->item, draggable->fill_or_stroke);
- if ( !SP_IS_MESHGRADIENT( gradient ) ) continue;
+ if ( !SP_IS_MESH( gradient ) ) continue;
selected_corners[ gradient ].push_back( draggable->point_i );
}
@@ -1374,8 +1374,8 @@ GrDragger::updateHandles ( Geom::Point pc_old, MeshNodeOperation op )
// Must be a mesh gradient
SPGradient *gradient = getGradient(item, fill_or_stroke);
- if ( !SP_IS_MESHGRADIENT( gradient ) ) continue;
- SPMeshGradient *mg = SP_MESHGRADIENT( gradient );
+ if ( !SP_IS_MESH( gradient ) ) continue;
+ SPMesh *mg = SP_MESH( gradient );
// pc_old is the old corner position in desktop coordinates, we need it in gradient coordinate.
gradient = sp_gradient_convert_to_userspace (gradient, item, (fill_or_stroke == Inkscape::FOR_FILL) ? "fill" : "stroke");
@@ -1958,7 +1958,7 @@ void GrDrag::addDraggersLinear(SPLinearGradient *lg, SPItem *item, Inkscape::Pai
/**
*Add draggers for the mesh gradient mg on item
*/
-void GrDrag::addDraggersMesh(SPMeshGradient *mg, SPItem *item, Inkscape::PaintTarget fill_or_stroke)
+void GrDrag::addDraggersMesh(SPMesh *mg, SPItem *item, Inkscape::PaintTarget fill_or_stroke)
{
std::vector< std::vector< SPMeshNode* > > nodes = mg->array.nodes;
@@ -1977,7 +1977,7 @@ void GrDrag::addDraggersMesh(SPMeshGradient *mg, SPItem *item, Inkscape::PaintTa
// Make sure we have at least one patch defined.
if( mg->array.patch_rows() == 0 || mg->array.patch_columns() == 0 ) {
- std::cout << "Empty Mesh Gradient, No Draggers to Add" << std::endl;
+ std::cout << "Empty Mesh, No Draggers to Add" << std::endl;
return;
}
@@ -2032,7 +2032,7 @@ void GrDrag::addDraggersMesh(SPMeshGradient *mg, SPItem *item, Inkscape::PaintTa
}
default:
- std::cout << "Bad Mesh Gradient draggable type" << std::endl;
+ std::cout << "Bad Mesh draggable type" << std::endl;
break;
}
}
@@ -2097,8 +2097,8 @@ void GrDrag::updateDraggers()
addDraggersLinear( SP_LINEARGRADIENT(server), item, Inkscape::FOR_FILL );
} else if ( SP_IS_RADIALGRADIENT(server) ) {
addDraggersRadial( SP_RADIALGRADIENT(server), item, Inkscape::FOR_FILL );
- } else if ( SP_IS_MESHGRADIENT(server) ) {
- addDraggersMesh( SP_MESHGRADIENT(server), item, Inkscape::FOR_FILL );
+ } else if ( SP_IS_MESH(server) ) {
+ addDraggersMesh( SP_MESH(server), item, Inkscape::FOR_FILL );
}
}
}
@@ -2113,8 +2113,8 @@ void GrDrag::updateDraggers()
addDraggersLinear( SP_LINEARGRADIENT(server), item, Inkscape::FOR_STROKE );
} else if ( SP_IS_RADIALGRADIENT(server) ) {
addDraggersRadial( SP_RADIALGRADIENT(server), item, Inkscape::FOR_STROKE );
- } else if ( SP_IS_MESHGRADIENT(server) ) {
- addDraggersMesh( SP_MESHGRADIENT(server), item, Inkscape::FOR_STROKE );
+ } else if ( SP_IS_MESH(server) ) {
+ addDraggersMesh( SP_MESH(server), item, Inkscape::FOR_STROKE );
}
}
}
@@ -2169,9 +2169,9 @@ void GrDrag::updateLines()
Geom::Point center = getGradientCoords(item, POINT_RG_CENTER, 0, Inkscape::FOR_FILL);
addLine(item, center, getGradientCoords(item, POINT_RG_R1, 0, Inkscape::FOR_FILL), Inkscape::FOR_FILL);
addLine(item, center, getGradientCoords(item, POINT_RG_R2, 0, Inkscape::FOR_FILL), Inkscape::FOR_FILL);
- } else if ( SP_IS_MESHGRADIENT(server) ) {
+ } else if ( SP_IS_MESH(server) ) {
- SPMeshGradient *mg = SP_MESHGRADIENT(server);
+ SPMesh *mg = SP_MESH(server);
guint rows = mg->array.patch_rows();
guint columns = mg->array.patch_columns();
@@ -2231,10 +2231,10 @@ void GrDrag::updateLines()
Geom::Point center = getGradientCoords(item, POINT_RG_CENTER, 0, Inkscape::FOR_STROKE);
addLine(item, center, getGradientCoords(item, POINT_RG_R1, 0, Inkscape::FOR_STROKE), Inkscape::FOR_STROKE);
addLine(item, center, getGradientCoords(item, POINT_RG_R2, 0, Inkscape::FOR_STROKE), Inkscape::FOR_STROKE);
- } else if ( SP_IS_MESHGRADIENT(server) ) {
+ } else if ( SP_IS_MESH(server) ) {
// MESH FIXME: TURN ROUTINE INTO FUNCTION AND CALL FOR BOTH FILL AND STROKE.
- SPMeshGradient *mg = SP_MESHGRADIENT(server);
+ SPMesh *mg = SP_MESH(server);
guint rows = mg->array.patch_rows();
guint columns = mg->array.patch_columns();