carbon-app / carbon

:black_heart: Create and share beautiful images of your source code
https://carbon.now.sh
MIT License
34.5k stars 1.91k forks source link

overlap codes #1453

Open che-ri opened 1 year ago

che-ri commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '…'
  2. Click on '…'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Info (please complete the following information):

Code snippet
  

```dart
///static
class VendingMachine{
  static getCoke() {
    return 'coke';
  }
  static getWater(){
    return 'water';
  }
}

main(){
  var coke = VendingMachine.getCoke();
  var water = VendingMachine.getWater();
  print(coke);  //coke
  print(water); //water
}
```
  
angiejones commented 1 year ago

I think this may be related. If not, I'm happy to open another issue.

Lines are showing ok in Carbon but when I export as a png image, they are wrapping and the text is becoming out of order

Code

if(salary >= requiredSalary) {

    if(years >= requiredYearsEmployed){
        System.out.println("You qualify for the loan.");
    }
    else{
       System.out.println("Sorry, you do not qualify.");
    }
}

Carbon View

carbon_view

Exported View

carbon Notice on line 5, the }, ", and ); are all out of order now. Also on line 8, the text is on top of the }.

angiejones commented 1 year ago

For anyone looking for a workaround:

  1. Go to Settings (click gear icon in the top header)
  2. Choose Window
  3. Deselect auto adjust width

workaround