zooming

Joints break when zooming

落爺英雄遲暮 提交于 2020-01-02 16:18:47
问题 I've been rehearsing Sprite Kit lately and I've come across a very strange problem. When zooming (changing the scale of) the parent node, bodies that are joined together by SKPhysicsJointPin separate from each other gradually and then joints break. Let me show you the images. This is for the normal state: Here's when zoomed in: And here's when zoomed out: If you ask how I join bodies: I join the brown sticks to the blue nodes on the center of the blue nodes. Any ideas what my problem is? EDIT

How do I suppress window mouse wheel scrolling…?

冷暖自知 提交于 2020-01-01 02:48:08
问题 I'm working on a canvas app embedded in a page. I have it so you can zoom into the drawing with the mousewheel but unfortunately this scrolls the page as it is part of an article. Is it possible to prevent mousewheel scrolling on the window when I'm mousewheeling on a dom element?! 回答1: Attach an event handler for mousewheel (Not Gecko) / DOMMouseScroll (Not IE) and prevent its default action (that is to scroll content): if (element.addEventListener) element.addEventListener("DOMMouseScroll",

d3.js rewriting zoom example in version4

点点圈 提交于 2019-12-31 10:40:23
问题 Drag and Drop Example I am trying to rewrite part of this example above to use in my code, specifically this piece: function centerNode(source) { scale = zoomListener.scale(); x = -source.y0; y = -source.x0; x = x * scale + viewerWidth / 2; y = y * scale + viewerHeight / 2; d3.select('g').transition() .duration(duration) .attr("transform", "translate(" + x + "," + y + ")scale(" + scale + ")"); zoomListener.scale(scale); zoomListener.translate([x, y]); } However I am getting stuck since the v4

C++ Zoom into the centre of the screen in 2D coordinates

别说谁变了你拦得住时间么 提交于 2019-12-31 06:42:15
问题 I'm having difficulty working out the correct calculations in order to zoom into the centre of the screen in 2D coordinates whilst keeping everything in the correct scale. I have a vector which I use to handle moving around my map editor as follows: scroll = sf::Vector2<float>(-640.0f, -360.0f); It's set at -640.0f, -360.0f to make 0,0 the centre of the screen on initialising (based on my window being 1280x720). My zoom value ranges from 0.1f to 2.0f and it's increased or decreased in 0.05

D3.js Zoomable Sunburst not Zooming

陌路散爱 提交于 2019-12-31 05:18:46
问题 I have a static 3 level Sunburst diagram - http://colinwhite.net/Sunburst/ My data is being nested with this function http://colinwhite.net/Sunburst/js/treeRemapper.js My approach is based on this example - http://bl.ocks.org/mbostock/4348373 For some reason my zoom and tweening is not working - var width = 960, height = 700, radius = Math.min(width, height) / 2, color = d3.scale.category20c(); var x = d3.scale.linear().range([0, 2 * Math.PI]), y = d3.scale.sqrt().range([0, radius]); var svg

how can i set maximum and minimum zooming levels for image in android?

可紊 提交于 2019-12-30 07:48:33
问题 I have image zooming and dragging in my application my requirement is the image sets maximum and minimum zooming levels. I have used the below code. public class Touch extends Activity implements OnTouchListener { private static final String TAG = "Touch"; // These matrices will be used to move and zoom image Matrix matrix = new Matrix(); Matrix savedMatrix = new Matrix(); // We can be in one of these 3 states static final int NONE = 0; static final int DRAG = 1; static final int ZOOM = 2;

iOS 8 Safari - Can't scroll element's content when page is zoomed

对着背影说爱祢 提交于 2019-12-29 06:25:30
问题 This issue happens only in iOS 8 (8.1 to be exact). It does not reproduce in iOS 7. The use-case: Scrolling inside an element with scrollable (long) content. If the page is not zoomed-in - it works as expected. When you zoom-in the page - it stops working, the page is scrolled instead (as if you reached the end of the scrollable content). The effect is continuous: the higher the zoom - it's less possible to scroll the content. Test page: here Open the link in your iOS 8 Safari - see that the

D3 Zoom resets scales selected via brushing.

℡╲_俬逩灬. 提交于 2019-12-25 06:32:03
问题 I've made zooming and brushing working together. The only problem is, when I've set the particular period on X axis via brushing and then trying to use zoom (on mouse drag or mouse wheel), it resets previous selected scales, so zoom doesn't store x axis domain that was set via brushing before. zoomRight = d3.behavior.zoom() .x(xScale) .y(yRightScale) .scaleExtent([1,20]) zoomed = -> zoomRight.scale(zoom.scale()).translate(zoom.translate()) canvas.select("._x._axis").call xAxis canvas.select("

Semantic zoom on map with circle showing capital

 ̄綄美尐妖づ 提交于 2019-12-25 05:36:27
问题 I wanted to implement semantic zoom on map of d3.js. I have developed a example of map and Major cities of particular country, which is working fine but sometime circle got overlap due to near places in maps so if i implement semantic zoom which will solve my circle overlapping problem. I don't understand how to transform only graph not circle in my map. My zooming function code is : var zoom = d3.behavior.zoom() .on("zoom",function() { g.attr("transform","translate("+ d3.event.translate.join

Site scaling on a mobile device

走远了吗. 提交于 2019-12-25 02:54:02
问题 Im a total newbie as far as mobile devices are concerned. Anyhow, i created a webpage (still under construction) and implemented it on the existing wp theme called govpress (yes, i know it might not be the most practical way to make things happen but with my coding skills it was the easiest). Now i just cant get it working correctly with mobile devices. I havent found the code that makes it behave as it does. So, on a mobile it seems to scale the page to screen width resolution of the device(