xref: /haiku/src/add-ons/print/drivers/gutenprint/GPBand.cpp (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2 * Copyright 2010, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Michael Pfeiffer
7 */
8 #include "GPBand.h"
9 
10 GPBand::GPBand(BBitmap* bitmap, BRect validRect, BPoint where)
11 	:
12 	fBitmap(*bitmap),
13 	fValidRect(validRect),
14 	fWhere(where)
15 {
16 
17 }
18 
19 
20 BRect
21 GPBand::GetBoundingRectangle() const
22 {
23 	BRect rect = fValidRect;
24 	rect.OffsetTo(fWhere);
25 	return rect;
26 }
27 
28 
29 bool
30 GPBand::ContainsLine(int line) const
31 {
32 	int y = line - (int)fWhere.y;
33 	return 0 <= y && y <= fValidRect.IntegerHeight();
34 }
35