From 888d3514967a90423d60dfa82bfd59b7f3df6c90 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 25 Jan 2023 19:15:30 +0800 Subject: [PATCH] Minor fixes to Android port * java/Makefile.in: (emacs.apk-in): Don't call cp with empty args. * java/org/gnu/emacs/EmacsDrawLine.java (perform): Fix for PostScript filling semantics. * src/Makefile.in (android-emacs): Build android-emacs directly. --- java/Makefile.in | 2 ++ java/org/gnu/emacs/EmacsDrawLine.java | 7 +++++-- src/Makefile.in | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/java/Makefile.in b/java/Makefile.in index b32b2442305..755995b93b1 100644 --- a/java/Makefile.in +++ b/java/Makefile.in @@ -150,7 +150,9 @@ emacs.apk-in: $(CROSS_BINS) $(CROSS_LIBS) $(libsrc)/asset-directory-tool \ cp -f $$file install_temp/lib/$(ANDROID_ABI); \ fi \ done +ifneq ($(NDK_BUILD_SHARED),) cp -f $(NDK_BUILD_SHARED) install_temp/lib/$(ANDROID_ABI) +endif # Package everything. Specifying the assets on this command line is # necessary for AAssetManager_getNextFileName to work on old versions # of Android. diff --git a/java/org/gnu/emacs/EmacsDrawLine.java b/java/org/gnu/emacs/EmacsDrawLine.java index 827feb96dfb..717e2279a7d 100644 --- a/java/org/gnu/emacs/EmacsDrawLine.java +++ b/java/org/gnu/emacs/EmacsDrawLine.java @@ -56,9 +56,12 @@ public class EmacsDrawLine paint.setStyle (Paint.Style.STROKE); + /* Since drawLine has PostScript style behavior, adjust the + coordinates appropriately. */ + if (gc.clip_mask == null) - canvas.drawLine ((float) x, (float) y, - (float) x2, (float) y2, + canvas.drawLine ((float) x + 0.5f, (float) y + 0.5f, + (float) x2 + 0.5f, (float) y2 + 0.5f, paint); /* DrawLine with clip mask not implemented; it is not used by diff --git a/src/Makefile.in b/src/Makefile.in index fe745770b9f..f9cfff14952 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -766,9 +766,10 @@ libemacs.so: $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ # There is also a binary named `android-emacs' which simply calls # emacs.so. -android-emacs: libemacs.so android-emacs.o - $(AM_V_CCLD)$(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) \ - $(LIBEGNU_ARCHIVE) -L. "-l:libemacs.so" android-emacs.o +android-emacs: libemacs.so android-emacs.c + $(AM_V_CCLD)$(CC) $(lastword $^) -o $@ \ + $(ALL_CFLAGS) $(LDFLAGS) \ + $(LIBEGNU_ARCHIVE) -L. "-l:libemacs.so" endif ## The following oldxmenu-related rules are only (possibly) used if -- 2.39.5