Commit 3da7a265 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

Add Annot::setColor()

parent 3eabdf57
......@@ -1070,7 +1070,24 @@ void Annot::setContents(GooString *new_content) {
obj1.initString(contents->copy());
update ("Contents", &obj1);
}
void Annot::setColor(AnnotColor *new_color) {
delete color;
if (new_color) {
Object obj1, obj2;
double *values = new_color->getValues();
obj1.initArray(xref);
for (int i = 0; i < (int)new_color->getSpace(); i++)
obj1.arrayAdd(obj2.initReal (values[i]));
update ("C", &obj1);
color = new_color;
} else {
color = NULL;
}
}
double Annot::getXMin() {
return rect->x1;
}
......
......@@ -504,7 +504,11 @@ public:
// Sets the annot contents to new_content
// new_content should never be NULL
void setContents(GooString *new_content);
// The annotation takes the ownership of
// new_color.
void setColor(AnnotColor *new_color);
// getters
Ref getRef() const { return ref; }
AnnotSubtype getType() const { return type; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment