@@ -139,11 +139,29 @@ 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
+ if (mouseX + x >= 0 ) {
143
+ nearestTarget = nearestTargetForBlockIn(b , possibleTargets);
144
+ if (nearestTarget != null ) {
145
+ updateFeedbackShape();
146
+ } else {
147
+ hideFeedbackShape();
148
+ }
149
+ if (b . base . canHaveSubstack1() && ! b . subStack1) {
150
+ updateHeight();
151
+ }
152
+ }
153
+ else {
154
+ nearestTarget = null ;
155
+ hideFeedbackShape();
156
+ }
157
+
158
+ fixCommentLayout();
159
+
160
+ function updateHeight(): void {
161
+ var h: int = BlockShape. EmptySubstackH;
162
+ if (nearestTarget != null ) {
163
+ var t:* = nearestTarget[ 1 ];
164
+ var o: Block = null ;
147
165
switch (nearestTarget[ 2 ] ) {
148
166
case INSERT_NORMAL :
149
167
o = t. nextBlock;
@@ -158,17 +176,17 @@ public class ScriptsPane extends ScrollFrameContents {
158
176
o = t. subStack2;
159
177
break ;
160
178
}
161
- }
162
- var h: int = BlockShape. EmptySubstackH;
163
- if (o) {
164
- h = o. height ;
165
- if (! o. bottomBlock(). isTerminal) h -= BlockShape. NotchDepth;
179
+ if (o) {
180
+ h = o. height ;
181
+ if (! o. bottomBlock(). isTerminal) h -= BlockShape. NotchDepth;
182
+ }
166
183
}
167
184
b . previewSubstack1Height(h);
168
185
}
169
- if (nearestTarget != null ) {
170
- var localP : Point = globalToLocal (nearestTarget [ 0 ] ) ;
186
+
187
+ function updateFeedbackShape() : void {
171
188
var t:* = nearestTarget[ 1 ];
189
+ var localP: Point = globalToLocal (nearestTarget[ 0 ] );
172
190
feedbackShape. x = localP. x ;
173
191
feedbackShape. y = localP. y ;
174
192
feedbackShape. visible = true ;
@@ -181,10 +199,7 @@ public class ScriptsPane extends ScrollFrameContents {
181
199
var isInsertion: Boolean = (insertionType != INSERT_ABOVE ) && (insertionType != INSERT_WRAP );
182
200
feedbackShape. copyFeedbackShapeFrom(b , false , isInsertion, wrapH);
183
201
}
184
- } else {
185
- hideFeedbackShape();
186
202
}
187
- fixCommentLayout();
188
203
}
189
204
190
205
public function allStacks ():Array {
0 commit comments