Commit 3c93e7eb authored by Mario Botsch's avatar Mario Botsch

fix whiteboard bugs

- correct inconsistencies between old annotations and new whiteboard,
regarding centered slides.
- fix vertical centering upon reload in Firefox
parent 8c161c19
......@@ -852,6 +852,14 @@ let RevealWhiteboard = (function(){
console.log("whiteboard loaded");
}
// fix inconsistency for centered slides
if (storage.whiteboardVersion == 2 && Reveal.getConfig().center)
{
document.querySelectorAll( 'svg.whiteboard path' ).forEach( path => {
path.setAttribute('transform', 'translate(0 40)');
});
}
// adjust height for PDF export
if (printMode)
{
......@@ -907,7 +915,7 @@ let RevealWhiteboard = (function(){
*/
function annotationData()
{
let storage = { whiteboardVersion: 2.0, annotations: [] };
let storage = { whiteboardVersion: 3.0, annotations: [] };
slides.querySelectorAll( 'svg.whiteboard' ).forEach( svg => {
if (svg.children.length) {
......@@ -1442,7 +1450,6 @@ let RevealWhiteboard = (function(){
// whenever slide changes, update slideIndices and redraw
Reveal.addEventListener( 'ready', setupSlides );
Reveal.addEventListener( 'ready', slideChanged );
Reveal.addEventListener( 'slidechanged', slideChanged );
......@@ -1490,6 +1497,9 @@ let RevealWhiteboard = (function(){
selectPenColor(penColors[0]);
selectPenRadius(2);
// put centered slides in flex-layout
setupSlides();
// hide buttons in print mode
if (printMode) buttons.style.display = 'none';
......
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