-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where a BitmapFont could become zero width or height (#56)
* Fix a bug where a BitmapFont could become zero width or height * Ensure we don't scale imeages that don't need scaling Previously images that didn't need to be scaled where sometimes incorrectly scaled. This patch fixes that.
- Loading branch information
1 parent
882c487
commit 29d2bc8
Showing
17 changed files
with
306 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+386 Bytes
...bitmapFontCropTest2/res/drawable/wfs_0_84beb937_1dd8_4ca7_afc6_9d52ee68188b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+409 Bytes
...bitmapFontCropTest2/res/drawable/wfs_1_7fd1e3ba_f9e5_4114_95d0_404fd95b0f1c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+391 Bytes
...bitmapFontCropTest2/res/drawable/wfs_2_1cd08553_4def_4929_ae79_e4e95dc8e7d2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+353 Bytes
...bitmapFontCropTest2/res/drawable/wfs_3_f50b11ef_1120_43f1_8c23_ae8f4d968b77.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+450 Bytes
...bitmapFontCropTest2/res/drawable/wfs_4_478cdc4e_a2d3_4a0b_a363_0141236a4fb2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+394 Bytes
...bitmapFontCropTest2/res/drawable/wfs_5_6060f0fa_b314_403c_8ef3_8b2127cdf8a5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+382 Bytes
...bitmapFontCropTest2/res/drawable/wfs_6_82227af2_ab99_4635_a282_f18e61f6a4e5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+400 Bytes
...bitmapFontCropTest2/res/drawable/wfs_7_3bc978df_2037_4d89_b3bd_a52b01f702f0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+328 Bytes
...bitmapFontCropTest2/res/drawable/wfs_8_f5b0994f_24cc_43d3_823c_b4d12dbea6f8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+383 Bytes
...bitmapFontCropTest2/res/drawable/wfs_9_142c8d9c_ac84_4358_8512_a0a23bafa6bc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+399 Bytes
.../bitmapFontCropTest2/res/drawable/wfs__bcea73dd_7a37_467f_94c8_f57f413c1618.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions
138
tools/wff-optimizer/src/test/resources/bitmapFontCropTest2/res/raw/watchface.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<WatchFace | ||
clipShape="CIRCLE" | ||
height="450" | ||
width="450"> | ||
<Metadata | ||
key="CLOCK_TYPE" | ||
value="ANALOG" /> | ||
<BitmapFonts> | ||
<BitmapFont name="Bitmap font 1"> | ||
<Character | ||
name=":" | ||
height="100" | ||
resource="wfs__bcea73dd_7a37_467f_94c8_f57f413c1618" | ||
width="100" /> | ||
<Character | ||
name="0" | ||
height="110" | ||
resource="wfs_0_84beb937_1dd8_4ca7_afc6_9d52ee68188b" | ||
width="60" /> | ||
<Character | ||
name="1" | ||
height="110" | ||
resource="wfs_1_7fd1e3ba_f9e5_4114_95d0_404fd95b0f1c" | ||
width="60" /> | ||
<Character | ||
name="2" | ||
height="110" | ||
resource="wfs_2_1cd08553_4def_4929_ae79_e4e95dc8e7d2" | ||
width="60" /> | ||
<Character | ||
name="3" | ||
height="110" | ||
resource="wfs_3_f50b11ef_1120_43f1_8c23_ae8f4d968b77" | ||
width="60" /> | ||
<Character | ||
name="4" | ||
height="110" | ||
resource="wfs_4_478cdc4e_a2d3_4a0b_a363_0141236a4fb2" | ||
width="60" /> | ||
<Character | ||
name="5" | ||
height="110" | ||
resource="wfs_5_6060f0fa_b314_403c_8ef3_8b2127cdf8a5" | ||
width="60" /> | ||
<Character | ||
name="6" | ||
height="110" | ||
resource="wfs_6_82227af2_ab99_4635_a282_f18e61f6a4e5" | ||
width="60" /> | ||
<Character | ||
name="7" | ||
height="110" | ||
resource="wfs_7_3bc978df_2037_4d89_b3bd_a52b01f702f0" | ||
width="60" /> | ||
<Character | ||
name="8" | ||
height="110" | ||
resource="wfs_8_f5b0994f_24cc_43d3_823c_b4d12dbea6f8" | ||
width="60" /> | ||
<Character | ||
name="9" | ||
height="110" | ||
resource="wfs_9_142c8d9c_ac84_4358_8512_a0a23bafa6bc" | ||
width="60" /> | ||
</BitmapFont> | ||
</BitmapFonts> | ||
<Scene backgroundColor="#ff000000"> | ||
<DigitalClock | ||
alpha="255" | ||
height="134" | ||
pivotX="0.5" | ||
pivotY="0.5" | ||
width="420" | ||
x="12" | ||
y="106"> | ||
<TimeText | ||
align="CENTER" | ||
alpha="255" | ||
format="hh:mm" | ||
height="134" | ||
hourFormat="SYNC_TO_DEVICE" | ||
width="420" | ||
x="0" | ||
y="0"> | ||
<BitmapFont | ||
color="#ffffffff" | ||
family="Bitmap font 1" | ||
size="120" /> | ||
</TimeText> | ||
</DigitalClock> | ||
<DigitalClock | ||
alpha="255" | ||
height="134" | ||
pivotX="0.5" | ||
pivotY="0.5" | ||
width="420" | ||
x="12" | ||
y="234"> | ||
<TimeText | ||
align="CENTER" | ||
alpha="255" | ||
format="hh:mm" | ||
height="134" | ||
hourFormat="SYNC_TO_DEVICE" | ||
width="420" | ||
x="0" | ||
y="0"> | ||
<BitmapFont | ||
color="#ffffffff" | ||
family="Bitmap font 1" | ||
size="110" /> | ||
</TimeText> | ||
</DigitalClock> | ||
<DigitalClock | ||
alpha="255" | ||
height="134" | ||
pivotX="0.5" | ||
pivotY="0.5" | ||
width="420" | ||
x="12" | ||
y="0"> | ||
<TimeText | ||
align="CENTER" | ||
alpha="255" | ||
format="hh:mm" | ||
height="134" | ||
hourFormat="SYNC_TO_DEVICE" | ||
width="420" | ||
x="0" | ||
y="0"> | ||
<BitmapFont | ||
color="#ffffffff" | ||
family="Bitmap font 1" | ||
size="40" /> | ||
</TimeText> | ||
</DigitalClock> | ||
</Scene> | ||
</WatchFace> |
Binary file added
BIN
+2.6 KB
.../res/drawable-nodpi/wfs_sec_decorative_3e6538b4_6b9c_4b20_9c09_0e7ae4babb1c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.