Gitlab CSE Unil

Commit 6c8d5da7 authored by M. Chardon's avatar M. Chardon
Browse files

repercution des couleurs des tampons dans l'édition et dans le PDF généré

parent b3d5baea
......@@ -383,13 +383,13 @@ class pdf extends \FPDI {
break;
case 'stampcomment':
if ($annotation->displayrotation == 1) {
$imgFileFromFA = utils_stamp::getPngFromFont("arrows-v");
$imgFileFromFA = utils_stamp::getPngFromFont("arrows-v", $colourcartridge);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/twoway_v_pdf.png';
//$h = 20; //abs($sy - $ey);
//$w = $h * 37 / 96;
$sx = min($sx, $ex) - 6;
} else {
$imgFileFromFA = utils_stamp::getPngFromFont("arrows-h");
$imgFileFromFA = utils_stamp::getPngFromFont("arrows-h", $colourcartridge);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/twoway_h_pdf.png';
//$w = 20; //abs($sx - $ex);
//$h = $w * 37 / 96;
......@@ -407,7 +407,7 @@ class pdf extends \FPDI {
$this->SetXY($scartx, $scarty);
break;
case 'commentplus':
$imgFileFromFA = utils_stamp::getPngFromFont("commenting");
$imgFileFromFA = utils_stamp::getPngFromFont("commenting", $colourcartridge);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/comment.png';
$w = 16 * $this->scale;
$h = 16 * $this->scale;
......
......@@ -99,7 +99,7 @@ class utils_stamp {
imagealphablending($imageTmp, false);
// Create font colors
$fontColor = imagecolorallocate($imageTmp, $colorRGB['r'], $colorRGB['g'], $colorRGB['b']);
$fontColor = imagecolorallocate($imageTmp, $colorRGB['red'], $colorRGB['green'], $colorRGB['blue']);
$background = imagecolorallocatealpha($imageTmp, 255, 0, 255, 127);
// Draw rectangle
......
......@@ -3154,13 +3154,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this.shape_id = 'ct_stampcomment_' + (new Date().toJSON()).replace(/:/g, '').replace(/\./g, '');
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
var colorcartridge = this.get_color_cartridge();
var fleche = '<i id="'
+ this.shape_id
+ '_img" '
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
if (this.displayrotation > 0) {
fleche = '<i id="' + this.shape_id + '_img" '
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
}
node = Y.Node.create('<div id="' + this.shape_id + '">' + fleche + '</div>');
node.setStyles({
......@@ -3196,7 +3201,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds.bound([edit.start, edit.end]);
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(bounds.x, bounds.y));
node = Y.Node.create('<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>');
var colorcartridge = this.get_color_cartridge();
var nodeContent = '<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ '"></i></div>';
node = Y.Node.create(nodeContent);
node.setStyles({
'position': 'absolute',
'display': 'inline-block'
......@@ -4303,7 +4312,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position;
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>');
var colorcartridge = this.get_color_cartridge();
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i></div>');
node.setStyles({
'position': 'absolute',
'display': 'inline-block',
......
......@@ -3154,13 +3154,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this.shape_id = 'ct_stampcomment_' + (new Date().toJSON()).replace(/:/g, '').replace(/\./g, '');
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
var colorcartridge = this.get_color_cartridge();
var fleche = '<i id="'
+ this.shape_id
+ '_img" '
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
if (this.displayrotation > 0) {
fleche = '<i id="' + this.shape_id + '_img" '
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
}
node = Y.Node.create('<div id="' + this.shape_id + '">' + fleche + '</div>');
node.setStyles({
......@@ -3196,7 +3201,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds.bound([edit.start, edit.end]);
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(bounds.x, bounds.y));
node = Y.Node.create('<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>');
var colorcartridge = this.get_color_cartridge();
var nodeContent = '<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ '"></i></div>';
node = Y.Node.create(nodeContent);
node.setStyles({
'position': 'absolute',
'display': 'inline-block'
......@@ -4303,7 +4312,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position;
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>');
var colorcartridge = this.get_color_cartridge();
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i></div>');
node.setStyles({
'position': 'absolute',
'display': 'inline-block',
......
......@@ -49,7 +49,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position;
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>');
var colorcartridge = this.get_color_cartridge();
node = Y.Node.create('<div><i class="fa fa-commenting" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i></div>');
node.setStyles({
'position': 'absolute',
'display': 'inline-block',
......
......@@ -50,13 +50,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this.shape_id = 'ct_stampcomment_' + (new Date().toJSON()).replace(/:/g, '').replace(/\./g, '');
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
var colorcartridge = this.get_color_cartridge();
var fleche = '<i id="'
+ this.shape_id
+ '_img" '
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
if (this.displayrotation > 0) {
fleche = '<i id="' + this.shape_id + '_img" '
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>';
+ 'class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ ';"></i>';
}
node = Y.Node.create('<div id="' + this.shape_id + '">' + fleche + '</div>');
node.setStyles({
......@@ -92,7 +97,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds.bound([edit.start, edit.end]);
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(bounds.x, bounds.y));
node = Y.Node.create('<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>');
var colorcartridge = this.get_color_cartridge();
var nodeContent = '<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:'
+ colorcartridge
+ '"></i></div>';
node = Y.Node.create(nodeContent);
node.setStyles({
'position': 'absolute',
'display': 'inline-block'
......
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