Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb53dc8

Browse files
rendering position x tune lifeline and message
1 parent3b950a3 commitfb53dc8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎daisy_sequence/js/renderer.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,10 @@ module.exports.Renderer = class Renderer{
406406
lifeline.y=message_of_create.y-(24+5);
407407
}
408408

409+
constTEXTOFFSET=4;
409410
// 空の名前を表示しようとすると、lifelineの表示が消えて位置計算もおかしくなるので、対処する
410411
constshow_name=(!/^\s*$/.test(lifeline.text))?lifeline.text :'-';
411-
lettext=lifeline_group.text(show_name).move(lifeline.x,lifeline.y).font({
412+
lettext=lifeline_group.text(show_name).move(lifeline.x+TEXTOFFSET,lifeline.y).font({
412413
'fill':'#000',
413414
'size':'24px',
414415
});
@@ -436,7 +437,7 @@ module.exports.Renderer = class Renderer{
436437
.attr(attr).radius(radius);
437438
}else{
438439
box={
439-
'x':b.x-padding,
440+
'x':b.x-TEXTOFFSET,
440441
'y':b.y-padding,
441442
'width':b.width+(padding*2)+offset[0],
442443
'height':b.height+offset[1],
@@ -495,8 +496,9 @@ module.exports.Renderer = class Renderer{
495496
letposition=Message.get_position(message,diagram);
496497
// console.log("%d %d %d", position.width, start_rank, end_rank);
497498
conststart_offset_x=start_rank*Spec.WIDTH();
498-
position.x+=start_offset_x;
499-
position.width+=(end_rank*Spec.WIDTH())-start_offset_x;
499+
constend_offset_x=end_rank*Spec.WIDTH();
500+
position.x+=start_offset_x-1;// とりあえずの調整のための理由のない1
501+
position.width+=end_offset_x-start_offset_x;
500502

501503
if(!message.hasOwnProperty('work')){
502504
message.work={};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp