Kaydet (Commit) 4bd05b8a authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Correctly offset based on tile position.

This works well at 100% zoom, but the offsets are still not correct
at zoom levels other than 100%.

Change-Id: I301362b00ca916410b69f39aa58ed871ce177d88
üst 07703967
...@@ -874,7 +874,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod ...@@ -874,7 +874,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
void ScGridWindow::PaintTile( VirtualDevice& rDevice, void ScGridWindow::PaintTile( VirtualDevice& rDevice,
int nOutputWidth, int nOutputHeight, int nOutputWidth, int nOutputHeight,
int /*nTilePosX*/, int /*nTilePosY*/, int nTilePosX, int nTilePosY,
long nTileWidth, long nTileHeight ) long nTileWidth, long nTileHeight )
{ {
// Output size is in pixels while tile position and size are in logical units (twips). // Output size is in pixels while tile position and size are in logical units (twips).
...@@ -898,7 +898,8 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, ...@@ -898,7 +898,8 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
pViewData->SetZoom(aFracX, aFracY, true); pViewData->SetZoom(aFracX, aFracY, true);
pViewData->RefreshZoom(); pViewData->RefreshZoom();
rDevice.SetOutputSizePixel(Size(nOutputWidth, nOutputHeight)); double fTilePosXPixel = static_cast<double>(nTilePosX) * PIXEL_PER_TWIPS;
double fTilePosYPixel = static_cast<double>(nTilePosY) * PIXEL_PER_TWIPS;
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
...@@ -914,7 +915,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, ...@@ -914,7 +915,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
pDoc->FillInfo(aTabInfo, nCol1, nRow1, nCol2, nRow2, nTab, fPPTX, fPPTY, false, false, NULL); pDoc->FillInfo(aTabInfo, nCol1, nRow1, nCol2, nRow2, nTab, fPPTX, fPPTY, false, false, NULL);
ScOutputData aOutData( ScOutputData aOutData(
&rDevice, OUTTYPE_WINDOW, aTabInfo, pDoc, nTab, 0, 0, nCol1, nRow1, nCol2, nRow2, fPPTX, fPPTY); &rDevice, OUTTYPE_WINDOW, aTabInfo, pDoc, nTab, -fTilePosXPixel, -fTilePosYPixel, nCol1, nRow1, nCol2, nRow2, fPPTX, fPPTY);
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig(); const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
Color aGridColor = rColorCfg.GetColorValue(svtools::CALCGRID, false).nColor; Color aGridColor = rColorCfg.GetColorValue(svtools::CALCGRID, false).nColor;
......
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