ET++: Port::StrokeLine()

Port::StrokeLink() draws a line in a graphical port. Note that this provides two-dimensional scaling and offset, effectively providing an arbitrary rectangularly-aligned coordinate system. Once this method has determined where the transformed line should be drawing, it calls the low-level device-dependent Port::DevStrokeLine() to do the drawing.


void Port::StrokeLine(Ink *ink, int psz, GrLineCap cap, const Point &pp1,
								const Point &pp2)
{
	if (ignore)
		return;
	Point p1(pp1), p2(pp2);
	if (scale & 1) {
		ScalePoint(this, p1);
		ScalePoint(this, p2);
		ScaleInt(this, psz);
	}
	p1+= origin;
	p2+= origin;
	Rectangle rr(NormRect(p1,p2).Expand(Math::Max(2, psz)/2));
	if (Visible(ink, rr)) {
		p1+= fso;
		p2+= fso;
		DevStrokeLine(psz, rr, cap, p1, p2);
	}
}

Back to the graphical layout description

Back to the main ET++ page