<commit_before>package eu.ydp.empiria.player.client.module.img;

import java.util.Date;
import java.util.Map;

import com.google.gwt.canvas.dom.client.Context2d;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.LoadEvent;
import com.google.gwt.event.dom.client.LoadHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseMoveEvent;
import com.google.gwt.event.dom.client.MouseMoveHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.dom.client.TouchEndEvent;
import com.google.gwt.event.dom.client.TouchEndHandler;
import com.google.gwt.event.dom.client.TouchMoveEvent;
import com.google.gwt.event.dom.client.TouchMoveHandler;
import com.google.gwt.event.dom.client.TouchStartEvent;
import com.google.gwt.event.dom.client.TouchStartHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.xml.client.Element;

import eu.ydp.canvasadapter.client.CanvasAdapter;
import eu.ydp.canvasadapter.client.Context2dAdapter;
import eu.ydp.empiria.player.client.components.PanelWithScrollbars;
import eu.ydp.empiria.player.client.module.ModuleSocket;
import eu.ydp.empiria.player.client.util.IntegerUtils;

public class ExplorableCanvasImgContent extends Composite implements ImgContent {

	private static ExplorableCanvasImgContentUiBinder uiBinder = GWT.create(ExplorableCanvasImgContentUiBinder.class);

	interface ExplorableCanvasImgContentUiBinder extends UiBinder<Widget, ExplorableCanvasImgContent> {	}

	@UiField
	FlowPanel mainPanel;
	@UiField
	FlowPanel windowPanel;
	@UiField
	FlowPanel imagePanel;
	@UiField
	CanvasAdapter imageCanvas;
	@UiField
	PushButton zoominButton;
	@UiField
	PushButton zoomoutButton;
	@UiField
	Label consoleLabel;
	@UiField
	Image tempImage;
	@UiField
	Panel tempPanel;
	@UiField
	PanelWithScrollbars scrollbarsPanel;
	
	private Context2dAdapter context2d;
	private final int REDRAW_INTERVAL_MIN = 50;
	private FocusWidget focusCanvas;
	private double scale = 100.0d;
	private double scaleMin = 100.0d;
	private final double ZOOM_MAX = 8;
	private final double SCALE_STEP = 1.2d;
	private double imgX = 0;
	private double imgY = 0;
	private double prevX, prevY;
	private boolean moving = false;
	private boolean touchingButtons = false;
	private boolean zoomInClicked = false;
	private double originalImageWidth, originalImageHeight;
	private double originalImageAspectRatio;
	private double windowWidth = 300, windowHeight = 300;<commit_msg>set initial scale bug 64644<commit_after>package eu.ydp.empiria.player.client.module.img;

import java.util.Date;
import java.util.Map;

import com.google.gwt.canvas.dom.client.Context2d;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.LoadEvent;
import com.google.gwt.event.dom.client.LoadHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseMoveEvent;
import com.google.gwt.event.dom.client.MouseMoveHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.dom.client.TouchEndEvent;
import com.google.gwt.event.dom.client.TouchEndHandler;
import com.google.gwt.event.dom.client.TouchMoveEvent;
import com.google.gwt.event.dom.client.TouchMoveHandler;
import com.google.gwt.event.dom.client.TouchStartEvent;
import com.google.gwt.event.dom.client.TouchStartHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.xml.client.Element;

import eu.ydp.canvasadapter.client.CanvasAdapter;
import eu.ydp.canvasadapter.client.Context2dAdapter;
import eu.ydp.empiria.player.client.components.PanelWithScrollbars;
import eu.ydp.empiria.player.client.module.ModuleSocket;
import eu.ydp.empiria.player.client.util.IntegerUtils;

public class ExplorableCanvasImgContent extends Composite implements ImgContent {

	private static ExplorableCanvasImgContentUiBinder uiBinder = GWT.create(ExplorableCanvasImgContentUiBinder.class);

	interface ExplorableCanvasImgContentUiBinder extends UiBinder<Widget, ExplorableCanvasImgContent> {	}

	@UiField
	FlowPanel mainPanel;
	@UiField
	FlowPanel windowPanel;
	@UiField
	FlowPanel imagePanel;
	@UiField
	CanvasAdapter imageCanvas;
	@UiField
	PushButton zoominButton;
	@UiField
	PushButton zoomoutButton;
	@UiField
	Label consoleLabel;
	@UiField
	Image tempImage;
	@UiField
	Panel tempPanel;
	@UiField
	PanelWithScrollbars scrollbarsPanel;
	
	private Context2dAdapter context2d;
	private final int REDRAW_INTERVAL_MIN = 50;
	private FocusWidget focusCanvas;
	private double scale = 200.0d;
	private double scaleMin = 100.0d;
	private final double ZOOM_MAX = 8;
	private final double SCALE_STEP = 1.2d;
	private double imgX = 0;
	private double imgY = 0;
	private double prevX, prevY;
	private boolean moving = false;
	private boolean touchingButtons = false;
	private boolean zoomInClicked = false;
	private double originalImageWidth, originalImageHeight;
	private double originalImageAspectRatio;
	private double windowWidth = 300, windowHeight = 300;
{'fraction_non_alphanumeric': 0.10138929943836832, 'fraction_numerical': 0.00812887969258055, 'mean_word_length': 5.787362086258776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5529960', 'n_tokens_mistral': 2314, 'n_tokens_neox': 2258, 'n_words': 397}