зеркало из https://github.com/mozilla/gecko-dev.git
Fix printing of plugins in absolutely positioned divs to use the right
coordinates. Bug 225832, r+sr=roc
This commit is contained in:
Родитель
c3d8aafb61
Коммит
03359fa12a
|
@ -1632,21 +1632,18 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||||
pi->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
|
pi->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
|
||||||
window.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window;
|
window.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window;
|
||||||
|
|
||||||
// get a few things
|
// Get the offset of the DC
|
||||||
nsCOMPtr<nsIPrintSettings> printSettings;
|
nsTransform2D* rcTransform;
|
||||||
if (thePrinterContext) {
|
aRenderingContext.GetCurrentTransform(rcTransform);
|
||||||
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
|
rcTransform->GetTranslationCoord(&origin.x, &origin.y);
|
||||||
NS_ENSURE_TRUE(printSettings, NS_ERROR_FAILURE);
|
|
||||||
printSettings->GetMarginInTwips(margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Get the conversion factor between pixels and twips
|
||||||
aPresContext->GetTwipsToPixels(&t2p);
|
aPresContext->GetTwipsToPixels(&t2p);
|
||||||
GetOffsetFromView(aPresContext, origin, &parentWithView);
|
|
||||||
|
|
||||||
// set it all up
|
// set it all up
|
||||||
// XXX is windowless different?
|
// XXX is windowless different?
|
||||||
window.x = NSToCoordRound((origin.x + margin.left) * t2p);
|
window.x = origin.x;
|
||||||
window.y = NSToCoordRound((origin.y + margin.top ) * t2p);
|
window.y = origin.y;
|
||||||
window.width = NSToCoordRound(mRect.width * t2p);
|
window.width = NSToCoordRound(mRect.width * t2p);
|
||||||
window.height= NSToCoordRound(mRect.height * t2p);
|
window.height= NSToCoordRound(mRect.height * t2p);
|
||||||
window.clipRect.bottom = 0; window.clipRect.top = 0;
|
window.clipRect.bottom = 0; window.clipRect.top = 0;
|
||||||
|
|
|
@ -1632,21 +1632,18 @@ nsObjectFrame::Paint(nsIPresContext* aPresContext,
|
||||||
pi->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
|
pi->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);
|
||||||
window.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window;
|
window.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window;
|
||||||
|
|
||||||
// get a few things
|
// Get the offset of the DC
|
||||||
nsCOMPtr<nsIPrintSettings> printSettings;
|
nsTransform2D* rcTransform;
|
||||||
if (thePrinterContext) {
|
aRenderingContext.GetCurrentTransform(rcTransform);
|
||||||
thePrinterContext->GetPrintSettings(getter_AddRefs(printSettings));
|
rcTransform->GetTranslationCoord(&origin.x, &origin.y);
|
||||||
NS_ENSURE_TRUE(printSettings, NS_ERROR_FAILURE);
|
|
||||||
printSettings->GetMarginInTwips(margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Get the conversion factor between pixels and twips
|
||||||
aPresContext->GetTwipsToPixels(&t2p);
|
aPresContext->GetTwipsToPixels(&t2p);
|
||||||
GetOffsetFromView(aPresContext, origin, &parentWithView);
|
|
||||||
|
|
||||||
// set it all up
|
// set it all up
|
||||||
// XXX is windowless different?
|
// XXX is windowless different?
|
||||||
window.x = NSToCoordRound((origin.x + margin.left) * t2p);
|
window.x = origin.x;
|
||||||
window.y = NSToCoordRound((origin.y + margin.top ) * t2p);
|
window.y = origin.y;
|
||||||
window.width = NSToCoordRound(mRect.width * t2p);
|
window.width = NSToCoordRound(mRect.width * t2p);
|
||||||
window.height= NSToCoordRound(mRect.height * t2p);
|
window.height= NSToCoordRound(mRect.height * t2p);
|
||||||
window.clipRect.bottom = 0; window.clipRect.top = 0;
|
window.clipRect.bottom = 0; window.clipRect.top = 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче