File: simulate-initial-end-key.patch

package info (click to toggle)
xjig 2.4-14.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 892 kB
  • sloc: cpp: 10,177; makefile: 1,142; perl: 23
file content (27 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Simulate an initial "End" keypress to bring all pieces into view.
Author: Innocent De Marchi
Bug: https://bugs.debian.org/417916
Last-Update: 2018-01-03

--- a/xjig.C
+++ b/xjig.C
@@ -662,6 +662,19 @@
 		XMapRaised(dpy,win);
 	}
 
+	//Simulate an initial "End" keypress to bring all pieces into view	
+	int x1,y1,x2,y2;
+	stk->GetExtent(&x1,&y1,&x2,&y2);
+	stk->PanView( x1-win_size_x/2+(x2-x1)/2, y1-win_size_y/2+(y2-y1)/2 );
+	int	zf1=(int)(win_size_x*zoom_factor/(x2-x1));
+	int	zf2=(int)(win_size_y*zoom_factor/(y2-y1));
+	if (zf2<zf1)	zf1=zf2;
+	if (zf1>3) {
+	stk->ZoomView(win_size_x/2,win_size_y/2,zf1-zoom_factor);
+	stk->ExposeRegion(0,0,win_size_x,win_size_y);
+	}
+	//end simulate
+
 	while(!quit) {
 
 		if (!XPending(dpy)) {