scale

CSS elements (with sprites) on iPhone/iPad not scaling correctly

房东的猫 提交于 2019-12-11 21:32:20
问题 I have a list on my main page which each has a link. Each list item has a different height and width which act like blocks on the page. Inside each list item is a link to another area on my side. Wrapped around this list is a container div, with a header and footer like most sites. The ul also uses a CSS sprite for the images, so that the normal picture is only about half the height of the image, and the bottom are the other image sprites. For some reason the on an iphone/ipad are not scaling

how to scale divs when i minimize browser so that divs dont collapse over each other

喜你入骨 提交于 2019-12-11 18:51:29
问题 i have small question. how is it possible to set the heights of 2 divs so that they dont collapse but rather scale dynamically if i minimize the window? i did this in js: $(document).ready(function(){ var footer = document.getElementById('footer').offsetHeight; var sidebar = document.getElementById('sidebar').offsetHeight; document.getElementById('sidebar').style.height = sidebar - footer + 'px'; }); this is working but not when i minimize, do i have to do it in a function and call it during

Save scaled image to sdcard android

拜拜、爱过 提交于 2019-12-11 18:23:32
问题 i've the following code, that scale the object. Now i want to save the scaled image to sdcard, please help me regarding that i've searched many but didn't find any public boolean onTouch(View v, MotionEvent event) { ImageView view = (ImageView) v; // Dump touch event to log dumpEvent(event); // Handle touch events here... switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: savedMatrix.set(matrix); start.set(event.getX(), event.getY()); Log.d(TAG, "mode=DRAG");

Flash AS3 - How to center an object around a point after scale

限于喜欢 提交于 2019-12-11 18:14:42
问题 I've created an mc which functions as my map and controls to go with that which allow the map to be moved around and key points navigated to and zoomed in on at varying zoom levels. I'm using scaleX and scaleY to scale the map mc and a list of x and y positions to correctly position the map for each key point. When I want to go to a certain area I perform this calculation (offsetX and offsetY are the center of the screen): newX = posX * scale + offsetX; newY = posY * scale + offsetY; Then I

ggplot not adding legend. What am I missing? very new to R

你。 提交于 2019-12-11 18:14:05
问题 I'm plotting three samples with ggplot but it's not adding a legend for the samples. It's not spitting out any error message so I'm not sure where I'm going wrong. I'd really appreicate some guidance. I've tried to declare color for each sample for the legend manually but there is still no legend on the plot. df<-data.frame(samples$V1, samples$V2, samples$V3, samples$V4, samples$V5, samples$V6, samples$V7) CG_methplot <- ggplot(df, aes(x=samples$V1,))+ scale_x_continuous(breaks=number_ticks

statistical formula for scale function in R

拥有回忆 提交于 2019-12-11 16:21:29
问题 what is mathematical formula of scale in R? I just tried the following but it is not the same as scale(X) ( X-colmeans(X))/ sapply(X, sd) 回答1: Since vector subtraction from matrices/data-frames works column-wise instead of row-wise, you have to transpose the matrix/data-frame before subtraction and then transpose back at the end. The result is the same as scale except for rounding errors. This is obviously a hassle to do, which I guess is why there's a convenience function. x <- as.data.frame

Getting top and left of a CSS scaled element's normal state with jQuery?

拟墨画扇 提交于 2019-12-11 16:17:10
问题 I'm scaling an element on hover with transform: scale(1.2); Now I need to get the top and left position on hover, but it gives me the top and left of the scaled position.. Makes sense, but I'd like the normal state top and left? Is there an easy way to get this? 回答1: Depending on transform-origin and the alignment of your element, you can calculate the additional offset by multiplying the width and height by the multiplier of scaleX and scaleY. Example: var element = $("#myDiv"); var prefixes

Change axis ticks and label to switch between millimeter and inch in QWT Plot

ⅰ亾dé卋堺 提交于 2019-12-11 12:17:37
问题 What I want is to switch axis labels and ticks to match as best for displaying inch and millimeters without changing curve points. I created a custom QwtScaleDraw and overwrote label() method, but this will not change the ticks. class QwtMyScaleDraw : public QwtScaleDraw { public: QwtMyScaleDraw() : QwtScaleDraw() { } protected: QwtText label(double value) const { // global conversion routine that creates a display string either as millimeter or inch return ConvertToString(value,

Resize rotated image to fill a view

折月煮酒 提交于 2019-12-11 12:15:32
问题 I'm trying to resize a UIImage so that it totally covers it's parent view. It's not hard to do this when the image isn't transformed. How do I do it for any arbitrary rotation (e.g., 30 degrees, 97 degrees, 277 degrees, etc.)? In the example below, I want the flower image to scale just enough so none of the white view is visible. I'd also like the origin as close to 0,0 as possible. In other words, I want want it aligned with the top, left corner. Any ideas? Bonus Question: I'd also like the

how to handle android screens fragmentations?

こ雲淡風輕ζ 提交于 2019-12-11 11:22:01
问题 i wish to write the layout and code just once so that it would look good on all devices . i've tried many ways (yes, including what google suggests, to use DP and also add multiple layout files) , but none really solves the problem of having to deal with a new situation each time there is a new device with a random resolution and density. the DP usage is just an XML trick that lets the dimensions stay the same on all screens like a ruler (for example , 1cm stays 1cm on all screens) ,so it's