- if getid(n) == id_whatsit then
- if getsubtype(n) == sid_user and getfield(n, 'user_id') == RUBY_PRE then
- local nv = getfield(n, 'value')
- max_allow_pre = has_attr(nv, attr_ruby_maxprep) or 0
- local atr = has_attr(n, attr_ruby) or 0
- if atr >0 then
- -- 直前のルビで intrusion がおこる可能性あり.
- -- 前 run のデータが残っていればそれを使用,
- -- そうでなければ行中形のデータを利用する
- local op = old_break_info[atr] or post_intrusion_backup
- max_allow_pre = max(0, max_allow_pre - op)
- end
- post_intrusion_backup = 0
- max_allow_post = has_attr(nv, attr_ruby_maxpostp) or 0
- max_margin = has_attr(nv, attr_ruby_maxmargin) or 0
- local coef = pre_low_cal_box(n, getfield(nv, 'value'))
- local s = node_tail(nv) --ルビ文字
- head, n = pre_low_app_node(
- head, n, getfield(nv, 'value'), coef,
- getfield(s, 'height'), getfield(s, 'depth')
- )
- else
- n = node_next(n)
+ if getsubtype(n) == sid_user and getfield(n, 'user_id') == RUBY_PRE then
+ local nv = getfield(n, 'value')
+ max_allow_pre = has_attr(nv, attr_ruby_maxprep) or 0
+ local atr = has_attr(n, attr_ruby) or 0
+ if max_allow_pre < 0 then
+ if atr>0 then
+ -- 直前のルビで intrusion がおこる可能性あり.
+ -- 前 run のデータが残っていればそれを使用,
+ -- そうでなければ行中形のデータを利用する
+ local op = old_break_info[atr] or post_intrusion_backup
+ max_allow_pre = max(0, -max_allow_pre - op)
+ else
+ max_allow_pre = -max_allow_pre
+ end