@@ -139,11 +139,12 @@ public class ScriptsPane extends ScrollFrameContents {
139
139
}
140
140
141
141
public function updateFeedbackFor (b :Block ):void {
142
- nearestTarget = nearestTargetForBlockIn(b , possibleTargets);
143
- if (b . base . canHaveSubstack1() && ! b . subStack1) {
144
- var o: Block = null ;
145
- if (nearestTarget) {
146
- t = nearestTarget[ 1 ];
142
+
143
+ function updateHeight(): void {
144
+ var h: int = BlockShape. EmptySubstackH;
145
+ if (nearestTarget != null ) {
146
+ var t:* = nearestTarget[ 1 ];
147
+ var o: Block = null ;
147
148
switch (nearestTarget[ 2 ] ) {
148
149
case INSERT_NORMAL :
149
150
o = t. nextBlock;
@@ -158,17 +159,17 @@ public class ScriptsPane extends ScrollFrameContents {
158
159
o = t. subStack2;
159
160
break ;
160
161
}
161
- }
162
- var h: int = BlockShape. EmptySubstackH;
163
- if (o) {
164
- h = o. height ;
165
- if (! o. bottomBlock(). isTerminal) h -= BlockShape. NotchDepth;
162
+ if (o) {
163
+ h = o. height ;
164
+ if (! o. bottomBlock(). isTerminal) h -= BlockShape. NotchDepth;
165
+ }
166
166
}
167
167
b . previewSubstack1Height(h);
168
168
}
169
- if (nearestTarget != null ) {
170
- var localP : Point = globalToLocal (nearestTarget [ 0 ] ) ;
169
+
170
+ function updateFeedbackShape() : void {
171
171
var t:* = nearestTarget[ 1 ];
172
+ var localP: Point = globalToLocal (nearestTarget[ 0 ] );
172
173
feedbackShape. x = localP. x ;
173
174
feedbackShape. y = localP. y ;
174
175
feedbackShape. visible = true ;
@@ -181,9 +182,24 @@ public class ScriptsPane extends ScrollFrameContents {
181
182
var isInsertion: Boolean = (insertionType != INSERT_ABOVE ) && (insertionType != INSERT_WRAP );
182
183
feedbackShape. copyFeedbackShapeFrom(b , false , isInsertion, wrapH);
183
184
}
184
- } else {
185
+ }
186
+
187
+ if (mouseX + x >= 0 ) {
188
+ nearestTarget = nearestTargetForBlockIn(b , possibleTargets);
189
+ if (nearestTarget != null ) {
190
+ updateFeedbackShape();
191
+ } else {
192
+ hideFeedbackShape();
193
+ }
194
+ if (b . base . canHaveSubstack1() && ! b . subStack1) {
195
+ updateHeight();
196
+ }
197
+ }
198
+ else {
199
+ nearestTarget = null ;
185
200
hideFeedbackShape();
186
201
}
202
+
187
203
fixCommentLayout();
188
204
}
189
205
0 commit comments