Skip to content

Commit 3ce4fc5

Browse files
committed
fixed set size
1 parent ed6be14 commit 3ce4fc5

File tree

3 files changed

+4
-43
lines changed

3 files changed

+4
-43
lines changed

core/src/processing/android/PWatchFaceGLES.java

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ public boolean canDraw() {
5959
}
6060

6161
private class GLEngine extends Gles2WatchFaceService.Engine {
62-
// private static final long TICK_PERIOD_MILLIS = 100;
63-
// private Handler timeTick;
6462

6563
@Override
6664
public void onCreate(SurfaceHolder surfaceHolder) {
@@ -74,40 +72,11 @@ public void onCreate(SurfaceHolder surfaceHolder) {
7472
.build());
7573
if (sketch != null) {
7674
sketch.initSurface(PWatchFaceGLES.this, null);
77-
// graphics = sketch.g;
7875
sketch.start();
7976
}
80-
81-
// timeTick = new Handler(Looper.myLooper());
82-
// startTimerIfNecessary();
83-
84-
}
85-
86-
/*
87-
private void startTimerIfNecessary() {
88-
timeTick.removeCallbacks(timeRunnable);
89-
if (isVisible() && !isInAmbientMode()) {
90-
timeTick.post(timeRunnable);
91-
}
9277
}
9378

9479

95-
private final Runnable timeRunnable = new Runnable() {
96-
@Override
97-
public void run() {
98-
onSecondTick();
99-
if (isVisible() && !isInAmbientMode()) {
100-
timeTick.postDelayed(this, TICK_PERIOD_MILLIS);
101-
}
102-
}
103-
};
104-
105-
106-
private void onSecondTick() {
107-
invalidateIfNecessary();
108-
}
109-
*/
110-
11180
private void invalidateIfNecessary() {
11281
if (isVisible() && !isInAmbientMode()) {
11382
invalidate();
@@ -124,11 +93,7 @@ public void onGlContextCreated() {
12493
@Override
12594
public void onGlSurfaceCreated(int width, int height) {
12695
super.onGlSurfaceCreated(width, height);
127-
// graphics.setSize(width, height);
128-
// sketch.g.setSize(width, height);
129-
// sketch.surfaceChanged();
130-
131-
sketch.displayHeight = width;
96+
sketch.displayWidth = width;
13297
sketch.displayHeight = height;
13398
sketch.g.setSize(sketch.sketchWidth(), sketch.sketchHeight());
13499
sketch.surfaceChanged();

core/src/processing/core/PSurfaceAndroid2D.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,13 @@ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
358358
System.out.println("SketchSurfaceView2D.surfaceChanged() " + w + " " + h);
359359
}
360360

361-
sketch.displayHeight = w;
361+
sketch.displayWidth = w;
362362
sketch.displayHeight = h;
363363
graphics.setSize(sketch.sketchWidth(), sketch.sketchHeight());
364364
sketch.surfaceChanged();
365-
366-
// width = w;
367-
// height = h;
368-
//
369-
// g.setSize(w, h);
370365
}
371366

367+
372368
@Override
373369
public void onWindowFocusChanged(boolean hasFocus) {
374370
super.onWindowFocusChanged(hasFocus);

core/src/processing/opengl/PSurfaceGLES.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public void onSurfaceChanged(GL10 igl, int iwidth, int iheight) {
528528
// lib.init(iwidth, iheight);
529529

530530
// Display width/height might change if the orientation changes.
531-
sketch.displayHeight = iwidth;
531+
sketch.displayWidth = iwidth;
532532
sketch.displayHeight = iheight;
533533
graphics.setSize(sketch.sketchWidth(), sketch.sketchHeight());
534534
sketch.surfaceChanged();

0 commit comments

Comments
 (0)