Fossil SCM

Improved arrowheads on the timeline graph.

drh 2015-03-09 18:14 trunk
Commit 3c8b24d402037de4df0b2f9b3828bb0fc56bccbb
1 file changed +41 -13
+41 -13
--- src/timeline.c
+++ src/timeline.c
@@ -734,29 +734,57 @@
734734
@ }while( obj = obj.offsetParent );
735735
@ }
736736
@ return left;
737737
@ }
738738
@ function drawUpArrow(x,y0,y1){
739
- @ drawBox(lineClr,x,y0,x+1,y1);
739
+ @ drawBox(lineClr,x,y0+5,x+1,y1);
740
+ @ var n = document.createElement("div"),
741
+ @ l = x-2,
742
+ @ t = y0;
743
+ @ n.style.position = "absolute";
744
+ @ n.style.left = l+"px";
745
+ @ n.style.top = t+"px";
746
+ @ n.style.width = 0;
747
+ @ n.style.height = 0;
748
+ @ n.style.borderWidth = 0;
749
+ @ n.style.borderStyle = "solid";
750
+ @ n.style.borderColor = "transparent";
751
+ @ n.style.borderRightWidth = "3px";
752
+ @ n.style.borderBottomColor = "#000";
753
+ @ n.style.borderBottomStyle = "outset";
754
+ @ n.style.borderLeftWidth = "3px";
740755
@ if( y0+10>=y1 ){
741
- @ drawBox(lineClr,x-1,y0+1,x+2,y0+2);
742
- @ drawBox(lineClr,x-2,y0+3,x+3,y0+4);
743
- @ }else{
744
- @ drawBox(lineClr,x-1,y0+2,x+2,y0+4);
745
- @ drawBox(lineClr,x-2,y0+5,x+3,y0+7);
756
+ @ n.style.borderBottomWidth = "5px";
757
+ @ } else {
758
+ @ n.style.borderBottomWidth = "7px";
746759
@ }
760
+ @ cDiv.appendChild(n);
747761
@ }
748762
@ function drawThinArrow(y,xFrom,xTo){
763
+ @ var n = document.createElement("div"),
764
+ @ t = y-2;
765
+ @ n.style.position = "absolute";
766
+ @ n.style.top = t+"px";
767
+ @ n.style.width = 0;
768
+ @ n.style.height = "1px";
769
+ @ n.style.borderWidth = 0;
770
+ @ n.style.borderStyle = "solid";
771
+ @ n.style.borderColor = "transparent";
772
+ @ n.style.borderTopWidth = "2px";
773
+ @ n.style.borderBottomWidth = "2px";
749774
@ if( xFrom<xTo ){
750
- @ drawBox(lineClr,xFrom,y,xTo,y);
751
- @ drawBox(lineClr,xTo-3,y-1,xTo-2,y+1);
752
- @ drawBox(lineClr,xTo-4,y-2,xTo-4,y+2);
775
+ @ drawBox(lineClr,xFrom,y,xTo-3,y);
776
+ @ n.style.left = xTo-3+"px";
777
+ @ n.style.borderLeftWidth = "3px";
778
+ @ n.style.borderLeftColor = "#000";
753779
@ }else{
754
- @ drawBox(lineClr,xTo,y,xFrom,y);
755
- @ drawBox(lineClr,xTo+2,y-1,xTo+3,y+1);
756
- @ drawBox(lineClr,xTo+4,y-2,xTo+4,y+2);
780
+ @ drawBox(lineClr,xTo+3,y,xFrom,y);
781
+ @ n.style.left = xTo+1+"px";
782
+ @ n.style.borderRightWidth = "3px";
783
+ @ n.style.borderRightColor = "#000";
757784
@ }
785
+ @ cDiv.appendChild(n);
758786
@ }
759787
@ function drawThinLine(x0,y0,x1,y1){
760788
@ drawBox(lineClr,x0,y0,x1,y1);
761789
@ }
762790
@ function drawNodeBox(color,x0,y0,x1,y1){
@@ -788,11 +816,11 @@
788816
@ for(var i=0; i<n; i+=2){
789817
@ var x1 = p.au[i]*railPitch + left;
790818
@ var x0 = x1>p.x ? p.x+7 : p.x-6;
791819
@ var u = rowinfo[p.au[i+1]-1];
792820
@ if(u.id<p.id){
793
- @ drawBox(lineClr,x0,p.y,x1,p.y+1);
821
+ @ drawBox(lineClr,x0,p.y,x1+1,p.y+1);
794822
@ drawUpArrow(x1, u.y+6, p.y);
795823
@ }else{
796824
@ drawBox("#600000",x0,p.y,x1,p.y+1);
797825
@ drawBox("#600000",x1-1,p.y,x1,u.y+1);
798826
@ drawBox("#600000",x1,u.y,u.x-6,u.y+1);
799827
--- src/timeline.c
+++ src/timeline.c
@@ -734,29 +734,57 @@
734 @ }while( obj = obj.offsetParent );
735 @ }
736 @ return left;
737 @ }
738 @ function drawUpArrow(x,y0,y1){
739 @ drawBox(lineClr,x,y0,x+1,y1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
740 @ if( y0+10>=y1 ){
741 @ drawBox(lineClr,x-1,y0+1,x+2,y0+2);
742 @ drawBox(lineClr,x-2,y0+3,x+3,y0+4);
743 @ }else{
744 @ drawBox(lineClr,x-1,y0+2,x+2,y0+4);
745 @ drawBox(lineClr,x-2,y0+5,x+3,y0+7);
746 @ }
 
747 @ }
748 @ function drawThinArrow(y,xFrom,xTo){
 
 
 
 
 
 
 
 
 
 
 
749 @ if( xFrom<xTo ){
750 @ drawBox(lineClr,xFrom,y,xTo,y);
751 @ drawBox(lineClr,xTo-3,y-1,xTo-2,y+1);
752 @ drawBox(lineClr,xTo-4,y-2,xTo-4,y+2);
 
753 @ }else{
754 @ drawBox(lineClr,xTo,y,xFrom,y);
755 @ drawBox(lineClr,xTo+2,y-1,xTo+3,y+1);
756 @ drawBox(lineClr,xTo+4,y-2,xTo+4,y+2);
 
757 @ }
 
758 @ }
759 @ function drawThinLine(x0,y0,x1,y1){
760 @ drawBox(lineClr,x0,y0,x1,y1);
761 @ }
762 @ function drawNodeBox(color,x0,y0,x1,y1){
@@ -788,11 +816,11 @@
788 @ for(var i=0; i<n; i+=2){
789 @ var x1 = p.au[i]*railPitch + left;
790 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
791 @ var u = rowinfo[p.au[i+1]-1];
792 @ if(u.id<p.id){
793 @ drawBox(lineClr,x0,p.y,x1,p.y+1);
794 @ drawUpArrow(x1, u.y+6, p.y);
795 @ }else{
796 @ drawBox("#600000",x0,p.y,x1,p.y+1);
797 @ drawBox("#600000",x1-1,p.y,x1,u.y+1);
798 @ drawBox("#600000",x1,u.y,u.x-6,u.y+1);
799
--- src/timeline.c
+++ src/timeline.c
@@ -734,29 +734,57 @@
734 @ }while( obj = obj.offsetParent );
735 @ }
736 @ return left;
737 @ }
738 @ function drawUpArrow(x,y0,y1){
739 @ drawBox(lineClr,x,y0+5,x+1,y1);
740 @ var n = document.createElement("div"),
741 @ l = x-2,
742 @ t = y0;
743 @ n.style.position = "absolute";
744 @ n.style.left = l+"px";
745 @ n.style.top = t+"px";
746 @ n.style.width = 0;
747 @ n.style.height = 0;
748 @ n.style.borderWidth = 0;
749 @ n.style.borderStyle = "solid";
750 @ n.style.borderColor = "transparent";
751 @ n.style.borderRightWidth = "3px";
752 @ n.style.borderBottomColor = "#000";
753 @ n.style.borderBottomStyle = "outset";
754 @ n.style.borderLeftWidth = "3px";
755 @ if( y0+10>=y1 ){
756 @ n.style.borderBottomWidth = "5px";
757 @ } else {
758 @ n.style.borderBottomWidth = "7px";
 
 
759 @ }
760 @ cDiv.appendChild(n);
761 @ }
762 @ function drawThinArrow(y,xFrom,xTo){
763 @ var n = document.createElement("div"),
764 @ t = y-2;
765 @ n.style.position = "absolute";
766 @ n.style.top = t+"px";
767 @ n.style.width = 0;
768 @ n.style.height = "1px";
769 @ n.style.borderWidth = 0;
770 @ n.style.borderStyle = "solid";
771 @ n.style.borderColor = "transparent";
772 @ n.style.borderTopWidth = "2px";
773 @ n.style.borderBottomWidth = "2px";
774 @ if( xFrom<xTo ){
775 @ drawBox(lineClr,xFrom,y,xTo-3,y);
776 @ n.style.left = xTo-3+"px";
777 @ n.style.borderLeftWidth = "3px";
778 @ n.style.borderLeftColor = "#000";
779 @ }else{
780 @ drawBox(lineClr,xTo+3,y,xFrom,y);
781 @ n.style.left = xTo+1+"px";
782 @ n.style.borderRightWidth = "3px";
783 @ n.style.borderRightColor = "#000";
784 @ }
785 @ cDiv.appendChild(n);
786 @ }
787 @ function drawThinLine(x0,y0,x1,y1){
788 @ drawBox(lineClr,x0,y0,x1,y1);
789 @ }
790 @ function drawNodeBox(color,x0,y0,x1,y1){
@@ -788,11 +816,11 @@
816 @ for(var i=0; i<n; i+=2){
817 @ var x1 = p.au[i]*railPitch + left;
818 @ var x0 = x1>p.x ? p.x+7 : p.x-6;
819 @ var u = rowinfo[p.au[i+1]-1];
820 @ if(u.id<p.id){
821 @ drawBox(lineClr,x0,p.y,x1+1,p.y+1);
822 @ drawUpArrow(x1, u.y+6, p.y);
823 @ }else{
824 @ drawBox("#600000",x0,p.y,x1,p.y+1);
825 @ drawBox("#600000",x1-1,p.y,x1,u.y+1);
826 @ drawBox("#600000",x1,u.y,u.x-6,u.y+1);
827

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button