@ -18,6 +18,7 @@ import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.ElementCasePane ;
import com.fr.design.mainframe.JTemplate ;
import com.fr.design.roleAuthority.ReportAndFSManagePane ;
import com.fr.design.utils.ColorUtils ;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils ;
import com.fr.general.Background ;
import com.fr.general.ComparatorUtils ;
@ -1196,13 +1197,13 @@ public class GridUI extends ComponentUI {
}
//绘制吸附辅助线
paintAdsorbLines ( g2d , grid ) ;
paintAdsorbLines ( g2d , grid , elementCase ) ;
grid . ajustEditorComponentBounds ( ) ; // refresh size
}
//绘制吸附辅助线
private void paintAdsorbLines ( Graphics2D g2d , Grid grid ) {
private void paintAdsorbLines ( Graphics2D g2d , Grid grid , TemplateElementCase elementcase ) {
int verticalValue = grid . getVerticalValue ( ) ;
int horizontalValue = grid . getHorizontalValue ( ) ;
if ( grid . getAdsorbWidth ( ) < = 0 | | grid . getAdsorbHeight ( ) < = 0 ) {
@ -1212,13 +1213,18 @@ public class GridUI extends ComponentUI {
- columnWidthList . getRangeValue ( 0 , horizontalValue ) . toPixI ( resolution ) ) ;
int height = ( int ) ( grid . getAdsorbHeight ( ) * ( resolution * 1 . 0D / DesignerUIModeConfig . getInstance ( ) . getScreenResolution ( ) )
- rowHeightList . getRangeValue ( 0 , verticalValue ) . toPixI ( resolution ) ) ;
drawBoundsLine ( g2d , width , height ) ;
drawBoundsLine ( g2d , width , height , elementcase ) ;
}
private void drawBoundsLine ( Graphics2D g2d , int width , int height ) {
private void drawBoundsLine ( Graphics2D g2d , int width , int height , TemplateElementCase elementcase ) {
Paint oldPaint = g2d . getPaint ( ) ;
Stroke oldStroke = g2d . getStroke ( ) ;
g2d . setPaint ( Color . black ) ;
Color backgroundColor = AdjustWorkBookDefaultStyleUtils . adjustBack ( Color . WHITE ) ;
if ( ColorUtils . isDarkColor ( backgroundColor ) ) {
g2d . setPaint ( Color . white ) ;
} else {
g2d . setPaint ( Color . black ) ;
}
g2d . setStroke ( GraphDrawHelper . getStroke ( Constants . LINE_DASH_DOT ) ) ;
g2d . drawLine ( 0 , height , width , height ) ;
g2d . drawLine ( width , 0 , width , height ) ;