textrendering/textformatting/tbox/LAYEMU.CPP
branchRCL_3
changeset 11 6971d1c87c9a
parent 5 e96e8a131979
child 13 7ff7c6e94fea
equal deleted inserted replaced
5:e96e8a131979 11:6971d1c87c9a
  4010 	param.iMaxHeight = KMaxTInt;
  4010 	param.iMaxHeight = KMaxTInt;
  4011 	int visible_height = VisibleHeightInPixels();
  4011 	int visible_height = VisibleHeightInPixels();
  4012 	if (aDy > 0)		// text moves down; iBandTop decreases
  4012 	if (aDy > 0)		// text moves down; iBandTop decreases
  4013 		{
  4013 		{
  4014 		if (aTopNoLimitBorder)
  4014 		if (aTopNoLimitBorder)
  4015 	        iBandTop = desired_bandtop;
  4015 		    {
       
  4016 	        iBandTop = Max(0 - iText->LayoutHeight(),desired_bandtop);
       
  4017 		    }
  4016 		else
  4018 		else
  4017 		    iBandTop = Max(0,desired_bandtop);//Disallow text scrolled beyond top border
  4019 		    iBandTop = Max(0,desired_bandtop);//Disallow text scrolled beyond top border
  4018 		
  4020 		
  4019 		pixels_scrolled = old_bandtop - iBandTop;
  4021 		pixels_scrolled = old_bandtop - iBandTop;
  4020 		while (pixels_scrolled < aDy)
  4022 		while (pixels_scrolled < aDy)
  4054 		while (iText->LayoutHeight() - iBandTop < visible_height)
  4056 		while (iText->LayoutHeight() - iBandTop < visible_height)
  4055 			{
  4057 			{
  4056 			if (!AddFormattingAtEndL(param, height_increase,paragraphs_increase))
  4058 			if (!AddFormattingAtEndL(param, height_increase,paragraphs_increase))
  4057 				break;
  4059 				break;
  4058 			}
  4060 			}
       
  4061 		
       
  4062 		// Shift the whole band upwards if we're at the very end of the text
       
  4063 		// and there's no more text to format. This prevents a situation were
       
  4064 		// iText->LayoutHeight() < BandHeightInPixels.
       
  4065 		if ( aBottomNoLimitBorder && iText->LayoutHeight() - iBandTop < visible_height )
       
  4066 		    {
       
  4067 		    if ( iText->EndChar() > iText->Source()->DocumentLength() )
       
  4068 		        {
       
  4069 		        iBandTop = desired_bandtop;
       
  4070 		        return pixels_scrolled;
       
  4071 		        }
       
  4072 		    }
       
  4073 
  4059 		}
  4074 		}
  4060 
  4075 
  4061 	// Scroll blank space off the display if desired.
  4076 	// Scroll blank space off the display if desired.
  4062 	if (aScrollBlankSpace == EFDisallowScrollingBlankSpace && iText->LayoutHeight() - iBandTop < visible_height)
  4077 	if (aScrollBlankSpace == EFDisallowScrollingBlankSpace && iText->LayoutHeight() - iBandTop < visible_height)
  4063 		{
  4078 		{