891 if (!isValidPath(path)) { 892 return null; 893 } 894 895 int slash = path.lastIndexOf('/'); 896 String name = (slash < 0) ? path : path.substring(slash + 1); 897 898 if (name.contains("@2x")) { 899 return null; 900 } 901 902 int dot = name.lastIndexOf('.'); 903 String name2x = (dot < 0) ? name + "@2x" 904 : name.substring(0, dot) + "@2x" + name.substring(dot); 905 return (slash < 0) ? name2x : path.substring(0, slash + 1) + name2x; 906 } 907 908 private static boolean isValidPath(String path) { 909 return !path.isEmpty() && !path.endsWith("/") && !path.endsWith("."); 910 } 911 } | 891 if (!isValidPath(path)) { 892 return null; 893 } 894 895 int slash = path.lastIndexOf('/'); 896 String name = (slash < 0) ? path : path.substring(slash + 1); 897 898 if (name.contains("@2x")) { 899 return null; 900 } 901 902 int dot = name.lastIndexOf('.'); 903 String name2x = (dot < 0) ? name + "@2x" 904 : name.substring(0, dot) + "@2x" + name.substring(dot); 905 return (slash < 0) ? name2x : path.substring(0, slash + 1) + name2x; 906 } 907 908 private static boolean isValidPath(String path) { 909 return !path.isEmpty() && !path.endsWith("/") && !path.endsWith("."); 910 } 911 912 @Override 913 protected PlatformWindow getPlatformWindowUnderMouse() { 914 return CPlatformWindow.nativeGetTopmostPlatformWindowUnderMouse(); 915 } 916 } |