Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading SVG from context doesn't render properly when used as src in Img class. #558

Closed
MatthewHawkins opened this issue Mar 22, 2024 · 0 comments
Assignees
Labels
Status: Confirmed The issue is a bug and has been confirmed and an action will be taken Type: Enhancements Iterations on existing features or infrastructure
Milestone

Comments

@MatthewHawkins
Copy link
Member

package samples;

import com.webforj.App;
import com.webforj.annotation.AppTheme;
import com.webforj.annotation.AppTitle;
import com.webforj.annotation.InlineStyleSheet;
import com.webforj.component.html.elements.Img;
import com.webforj.component.layout.flexlayout.FlexLayout;
import com.webforj.component.window.Frame;
import com.webforj.exceptions.WebforjException;

/**
 * A simple HelloWorld app.
 */
@AppTheme("system")
@AppTitle("webforJ Hello World")
public class HelloWorldApp extends App {
  
  Img logo = new Img("context://images/logo.svg");
  private FlexLayout canvas = FlexLayout.create(logo).vertical()
      .justify().center()
      .align().center()
      .build();

  @Override
  public void run() throws WebforjException {

    Frame mainFrame = new Frame();
    mainFrame.addClassName("mainFrame");
    mainFrame.add(canvas);

    canvas.addClassName("canvas");
    logo.addClassName("logo");
  }
}

logo

@hyyan hyyan self-assigned this Mar 22, 2024
@hyyan hyyan added Status: Confirmed The issue is a bug and has been confirmed and an action will be taken Type: Enhancements Iterations on existing features or infrastructure labels May 22, 2024
@hyyan hyyan added this to the 24.02 milestone May 22, 2024
@hyyan hyyan closed this as completed in cb09446 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed The issue is a bug and has been confirmed and an action will be taken Type: Enhancements Iterations on existing features or infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants