Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/lib/view/util/stack_chan_rotary_robot_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,11 @@ class _StackChanRotaryRobotJsState extends State<StackChanRotaryRobotJs> {
final byteData = await image.toByteData(format: ui.ImageByteFormat.rawRgba);

if (byteData != null) {
//convertas three_js Uint8Array
final uint8List = byteData.buffer.asUint8List();
final nativeArray = three.Uint8Array.fromList(uint8List);

//updatetexture
expressionTexture.image = three.ImageElement(
data: nativeArray,
data: uint8List,
width: canvasWidth.toInt(),
height: canvasHeight.toInt(),
);
Expand Down
5 changes: 1 addition & 4 deletions app/lib/view/util/stackchan_robot_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,11 @@ class _StackchanRobotThreeState extends State<StackchanRobotJs> {
final byteData = await image.toByteData(format: ui.ImageByteFormat.rawRgba);

if (byteData != null) {
//convertas three_js Uint8Array
final uint8List = byteData.buffer.asUint8List();
final nativeArray = three.Uint8Array.fromList(uint8List);

//updatetexture
expressionTexture!.image = three.ImageElement(
data: nativeArray,
data: uint8List,
width: canvasWidth.toInt(),
height: canvasHeight.toInt(),
);
Expand Down Expand Up @@ -451,7 +449,6 @@ class _StackchanRobotThreeState extends State<StackchanRobotJs> {
return three.Color(1, 1, 1);
}
final intValue = int.parse(hex, radix: 16);
final int a = (intValue >> 24) & 0xFF;
final int r = (intValue >> 16) & 0xFF;
final int g = (intValue >> 8) & 0xFF;
final int b = intValue & 0xFF;
Expand Down