Commit 3beb71e9 authored by Oleg Korshul's avatar Oleg Korshul

.

parent d6beb4d7
...@@ -3229,13 +3229,24 @@ ...@@ -3229,13 +3229,24 @@
//console.log(_data); //console.log(_data);
}; };
this.Draw = function(context, w, h) this.Draw = function(context, dw_or_dx, dh_or_dy, dw, dh)
{ {
if (!this.image) if (!this.image)
return; return;
var x = (w - this.width) >> 1; var x = 0;
var y = (h - this.height) >> 1; var y = 0;
if (undefined == dw)
{
x = (dw_or_dx - this.width) >> 1;
y = (dh_or_dy - this.height) >> 1;
}
else
{
x = (dw_or_dx + ((dw - this.width) / 2)) >> 0;
y = (dh_or_dy + ((dh - this.height) / 2)) >> 0;
}
var oldGlobalAlpha = context.globalAlpha; var oldGlobalAlpha = context.globalAlpha;
context.globalAlpha = this.transparent; context.globalAlpha = this.transparent;
context.drawImage(this.image, x, y); context.drawImage(this.image, x, y);
......
...@@ -5502,7 +5502,7 @@ function CSlideDrawer() ...@@ -5502,7 +5502,7 @@ function CSlideDrawer()
outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px, h_px, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px); outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px, h_px, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
if (this.m_oWordControl.m_oApi.watermarkDraw) if (this.m_oWordControl.m_oApi.watermarkDraw)
this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, w_px, h_px); this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
} }
else else
{ {
...@@ -5519,7 +5519,7 @@ function CSlideDrawer() ...@@ -5519,7 +5519,7 @@ function CSlideDrawer()
outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px_src, h_px_src, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px); outputCtx.drawImage(this.CachedCanvas, 0, 0, w_px_src, h_px_src, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
if (this.m_oWordControl.m_oApi.watermarkDraw) if (this.m_oWordControl.m_oApi.watermarkDraw)
this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, w_px, h_px); this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, (_x >> 0) - this.SlideEps, (_y >> 0) - this.SlideEps, w_px, h_px);
} }
} }
else else
...@@ -5550,7 +5550,9 @@ function CSlideDrawer() ...@@ -5550,7 +5550,9 @@ function CSlideDrawer()
this.m_oWordControl.m_oLogicDocument.DrawPage(slideNum, g); this.m_oWordControl.m_oLogicDocument.DrawPage(slideNum, g);
if (this.m_oWordControl.m_oApi.watermarkDraw) if (this.m_oWordControl.m_oApi.watermarkDraw)
this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, w_px, h_px); {
this.m_oWordControl.m_oApi.watermarkDraw.Draw(outputCtx, _x, _y, w_px, h_px);
}
} }
} }
} }
......
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