@ -8,11 +8,11 @@ import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer ;
import com.fr.design.designer.creator.XWBorderLayout ;
import com.fr.design.designer.creator.XWFitLayout ;
import com.fr.design.designer.creator.XWParameterLayout ;
import com.fr.design.gui.ibutton.UIButton ;
import com.fr.design.gui.ibutton.UIButtonUI ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.gui.imenu.UIPopupMenu ;
import com.fr.design.designer.creator.XWParameterLayout ;
import com.fr.design.gui.itextfield.UINumberField ;
import com.fr.design.layout.FRGUIPaneFactory ;
import com.fr.design.layout.TableLayout ;
@ -540,21 +540,26 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
}
//获取在容器的绝对位置
Rectangle rec = ComponentUtils . getRelativeBounds ( creator ) ;
// 组件实际大小、位置要考虑缩放
int dWidth = getDesignerWidth ( ) ;
if ( rec . width < = dWidth & & rec . x < getHorizontalValue ( ) ) {
double recRealWidth = rec . width * designer . getScale ( ) ;
double recRealX = rec . x * designer . getScale ( ) ;
if ( recRealWidth < = dWidth & & recRealX < getHorizontalValue ( ) ) {
//在边界内部且x位置小于水平滚动条的值
horScrollBar . setValue ( rec . x ) ;
} else if ( rec . x + rec . w idth > dWidth + horizontalValue ) {
horScrollBar . setValue ( ( int ) recRealX ) ;
} else if ( recRealX + recRealW idth > dWidth + horizontalValue ) {
//超出边界宽度
horScrollBar . setValue ( rec . x + rec . w idth - dWidth ) ;
horScrollBar . setValue ( ( int ) ( recRealX + recRealW idth - dWidth ) ) ;
}
int dHeight = getDesignerHeight ( ) ;
if ( rec . height < dHeight & & rec . y < getVerticalValue ( ) ) {
double recRealHeight = rec . height * designer . getScale ( ) ;
double recRealY = rec . y * designer . getScale ( ) ;
if ( recRealHeight < dHeight & & recRealY < getVerticalValue ( ) ) {
//在边界内部且y位置小于竖直滚动条的值
verScrollBar . setValue ( rec . y ) ;
} else if ( rec . y + rec . h eight > dHeight + verticalValue ) {
verScrollBar . setValue ( ( int ) recRealY ) ;
} else if ( recRealY + recRealH eight > dHeight + verticalValue ) {
//超出边界高度
verScrollBar . setValue ( rec . y + rec . h eight - dHeight ) ;
verScrollBar . setValue ( ( int ) ( recRealY + recRealH eight - dHeight ) ) ;
}
}