summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7cffa9e)
raw | patch | inline | side by side (parent: 7cffa9e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 16 Oct 2007 05:09:39 +0000 (05:09 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 16 Oct 2007 05:09:39 +0000 (05:09 +0000) |
src/gradient-chemistry.cpp | patch | blob | history |
index 37b50eca019205c07945ca0a50e7622bb449b5bd..70bc835bc6420f993b45fdf93b28626361f24495 100644 (file)
#include "sp-text.h"
#include "sp-tspan.h"
#include <libnr/nr-matrix-fns.h>
+#include <libnr/nr-point-fns.h>
#include "xml/repr.h"
#include "svg/svg.h"
#include "svg/svg-color.h"
}
-// FIXME: make general global function
-static double
-get_offset_between_points (NR::Point p, NR::Point begin, NR::Point end)
-{
- double length = NR::L2(end - begin);
- NR::Point be = (end - begin) / length;
- double r = NR::dot(p - begin, be);
-
- if (r < 0.0) return 0.0;
- if (r > length) return 1.0;
-
- return (r / length);
-}
-
-
/**
Set the position of point point_type of the gradient applied to item (either fill_or_stroke) to
p_w (in desktop coordinates). Write_repr if you want the change to become permanent.